diff --git a/cmd/aro/monitor.go b/cmd/aro/monitor.go index e178a848627..fe0e32e3b04 100644 --- a/cmd/aro/monitor.go +++ b/cmd/aro/monitor.go @@ -25,7 +25,7 @@ import ( ) func monitor(ctx context.Context, log *logrus.Entry) error { - _env, err := env.NewCore(ctx, log) + _env, err := env.NewEnv(ctx, log) if err != nil { return err } @@ -126,7 +126,7 @@ func monitor(ctx context.Context, log *logrus.Entry) error { return err } - mon := pkgmonitor.NewMonitor(log.WithField("component", "monitor"), dialer, dbMonitors, dbOpenShiftClusters, dbSubscriptions, m, clusterm, liveConfig) + mon := pkgmonitor.NewMonitor(log.WithField("component", "monitor"), dialer, dbMonitors, dbOpenShiftClusters, dbSubscriptions, m, clusterm, liveConfig, _env) return mon.Run(ctx) } diff --git a/go.mod b/go.mod index 50b20782a19..bf890d68484 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/Azure/azure-sdk-for-go v63.1.0+incompatible github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/adal v0.9.23 github.com/Azure/go-autorest/autorest/date v0.3.0 diff --git a/go.sum b/go.sum index 963e85df6f1..5743bd308db 100644 --- a/go.sum +++ b/go.sum @@ -19,6 +19,10 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 h1:bWh0Z2rOEDfB/ywv/l0iHN1JgyazE6kW/aIA89+CEK0= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1/go.mod h1:Bzf34hhAE9NSxailk8xVeLEZbUjOXcC+GnU1mMKdhLw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= diff --git a/pkg/deploy/assets/rp-production.json b/pkg/deploy/assets/rp-production.json index 9b2afaf1c24..db0661a1228 100644 --- a/pkg/deploy/assets/rp-production.json +++ b/pkg/deploy/assets/rp-production.json @@ -516,7 +516,7 @@ "autoUpgradeMinorVersion": true, "settings": {}, "protectedSettings": { - "script": "[base64(concat(base64ToString('c2V0IC1leAoK'),'ACRRESOURCEID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('acrResourceId')),''')\n','ADMINAPICLIENTCERTCOMMONNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('adminApiClientCertCommonName')),''')\n','ARMAPICLIENTCERTCOMMONNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('armApiClientCertCommonName')),''')\n','ARMCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('armClientId')),''')\n','AZURECLOUDNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureCloudName')),''')\n','AZURESECPACKQUALYSURL=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureSecPackQualysUrl')),''')\n','AZURESECPACKVSATENANTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureSecPackVSATenantId')),''')\n','BILLINGE2ESTORAGEACCOUNTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('billingE2EStorageAccountId')),''')\n','CLUSTERMDMACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdmAccount')),''')\n','CLUSTERMDSDACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdAccount')),''')\n','CLUSTERMDSDCONFIGVERSION=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdConfigVersion')),''')\n','CLUSTERMDSDNAMESPACE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdNamespace')),''')\n','CLUSTERPARENTDOMAINNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterParentDomainName')),''')\n','DATABASEACCOUNTNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('databaseAccountName')),''')\n','DBTOKENCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('dbtokenClientId')),''')\n','FLUENTBITIMAGE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fluentbitImage')),''')\n','FPCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fpClientId')),''')\n','FPSERVICEPRINCIPALID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fpServicePrincipalId')),''')\n','GATEWAYDOMAINS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayDomains')),''')\n','GATEWAYRESOURCEGROUPNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayResourceGroupName')),''')\n','GATEWAYSERVICEPRINCIPALID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayServicePrincipalId')),''')\n','KEYVAULTDNSSUFFIX=$(base64 -d \u003c\u003c\u003c''',base64(parameters('keyvaultDNSSuffix')),''')\n','KEYVAULTPREFIX=$(base64 -d \u003c\u003c\u003c''',base64(parameters('keyvaultPrefix')),''')\n','MDMFRONTENDURL=$(base64 -d \u003c\u003c\u003c''',base64(parameters('mdmFrontendUrl')),''')\n','MDSDENVIRONMENT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('mdsdEnvironment')),''')\n','PORTALACCESSGROUPIDS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalAccessGroupIds')),''')\n','PORTALCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalClientId')),''')\n','PORTALELEVATEDGROUPIDS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalElevatedGroupIds')),''')\n','RPFEATURES=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpFeatures')),''')\n','RPIMAGE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpImage')),''')\n','RPMDMACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdmAccount')),''')\n','RPMDSDACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdAccount')),''')\n','RPMDSDCONFIGVERSION=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdConfigVersion')),''')\n','RPMDSDNAMESPACE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdNamespace')),''')\n','RPPARENTDOMAINNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpParentDomainName')),''')\n','CLUSTERSINSTALLVIAHIVE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clustersInstallViaHive')),''')\n','CLUSTERSADOPTBYHIVE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clustersAdoptByHive')),''')\n','CLUSTERDEFAULTINSTALLERPULLSPEC=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterDefaultInstallerPullspec')),''')\n','USECHECKACCESS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('useCheckAccess')),''')\n','ADMINAPICABUNDLE=''',parameters('adminApiCaBundle'),'''\n','ARMAPICABUNDLE=''',parameters('armApiCaBundle'),'''\n','MDMIMAGE=''/genevamdm:2.2023.928.2134-0de476-20230928t2244''\n','LOCATION=$(base64 -d \u003c\u003c\u003c''',base64(resourceGroup().location),''')\n','SUBSCRIPTIONID=$(base64 -d \u003c\u003c\u003c''',base64(subscription().subscriptionId),''')\n','RESOURCEGROUPNAME=$(base64 -d \u003c\u003c\u003c''',base64(resourceGroup().name),''')\n','\n',base64ToString('IyEvYmluL2Jhc2gKCmVjaG8gInNldHRpbmcgc3NoIHBhc3N3b3JkIGF1dGhlbnRpY2F0aW9uIgojIFdlIG5lZWQgdG8gbWFudWFsbHkgc2V0IFBhc3N3b3JkQXV0aGVudGljYXRpb24gdG8gdHJ1ZSBpbiBvcmRlciBmb3IgdGhlIFZNU1MgQWNjZXNzIEpJVCB0byB3b3JrCnNlZCAtaSAncy9QYXNzd29yZEF1dGhlbnRpY2F0aW9uIG5vL1Bhc3N3b3JkQXV0aGVudGljYXRpb24geWVzL2cnIC9ldGMvc3NoL3NzaGRfY29uZmlnCnN5c3RlbWN0bCByZWxvYWQgc3NoZC5zZXJ2aWNlCgplY2hvICJydW5uaW5nIFJIVUkgZml4Igp5dW0gdXBkYXRlIC15IC0tZGlzYWJsZXJlcG89JyonIC0tZW5hYmxlcmVwbz0ncmh1aS1taWNyb3NvZnQtYXp1cmUqJwoKZWNobyAicnVubmluZyB5dW0gdXBkYXRlIgp5dW0gLXkgLXggV0FMaW51eEFnZW50IC14IFdBTGludXhBZ2VudC11ZGV2IHVwZGF0ZSAtLWFsbG93ZXJhc2luZwoKZWNobyAiZXh0ZW5kaW5nIHBhcnRpdGlvbiB0YWJsZSIKIyBMaW51eCBibG9jayBkZXZpY2VzIGFyZSBpbmNvbnNpc3RlbnRseSBuYW1lZAojIGl0J3MgZGlmZmljdWx0IHRvIHRpZSB0aGUgbHZtIHB2IHRvIHRoZSBwaHlzaWNhbCBkaXNrIHVzaW5nIC9kZXYvZGlzayBmaWxlcywgd2hpY2ggaXMgd2h5IGx2cyBpcyB1c2VkIGhlcmUKcGh5c2ljYWxEaXNrPSIkKGx2cyAtbyBkZXZpY2VzIC1hIHwgaGVhZCAtbjIgfCB0YWlsIC1uMSB8IGN1dCAtZCAnICcgLWYgMyB8IGN1dCAtZCBcKCAtZiAxIHwgdHIgLWQgJ1s6ZGlnaXQ6XScpIgpncm93cGFydCAiJHBoeXNpY2FsRGlzayIgMgoKZWNobyAiZXh0ZW5kaW5nIGZpbGVzeXN0ZW1zIgpsdmV4dGVuZCAtbCArMjAlRlJFRSAvZGV2L3Jvb3R2Zy9yb290bHYKeGZzX2dyb3dmcyAvCgpsdmV4dGVuZCAtbCArMTAwJUZSRUUgL2Rldi9yb290dmcvdmFybHYKeGZzX2dyb3dmcyAvdmFyCgplY2hvICJpbXBvcnRpbmcgcnBtIHJlcG9zaXRvcmllcyIKcnBtIC0taW1wb3J0IGh0dHBzOi8vZGwuZmVkb3JhcHJvamVjdC5vcmcvcHViL2VwZWwvUlBNLUdQRy1LRVktRVBFTC04CnJwbSAtLWltcG9ydCBodHRwczovL3BhY2thZ2VzLm1pY3Jvc29mdC5jb20va2V5cy9taWNyb3NvZnQuYXNjCgpmb3IgYXR0ZW1wdCBpbiB7MS4uNX07IGRvCiAgeXVtIC15IGluc3RhbGwgaHR0cHM6Ly9kbC5mZWRvcmFwcm9qZWN0Lm9yZy9wdWIvZXBlbC9lcGVsLXJlbGVhc2UtbGF0ZXN0LTgubm9hcmNoLnJwbSAmJiBicmVhawogIGlmIFtbICR7YXR0ZW1wdH0gLWx0IDUgXV07IHRoZW4gc2xlZXAgMTA7IGVsc2UgZXhpdCAxOyBmaQpkb25lCgplY2hvICJjb25maWd1cmluZyBsb2dyb3RhdGUiCmNhdCA+L2V0Yy9sb2dyb3RhdGUuY29uZiA8PCdFT0YnCiMgc2VlICJtYW4gbG9ncm90YXRlIiBmb3IgZGV0YWlscwojIHJvdGF0ZSBsb2cgZmlsZXMgd2Vla2x5CndlZWtseQoKIyBrZWVwIDIgd2Vla3Mgd29ydGggb2YgYmFja2xvZ3MKcm90YXRlIDIKCiMgY3JlYXRlIG5ldyAoZW1wdHkpIGxvZyBmaWxlcyBhZnRlciByb3RhdGluZyBvbGQgb25lcwpjcmVhdGUKCiMgdXNlIGRhdGUgYXMgYSBzdWZmaXggb2YgdGhlIHJvdGF0ZWQgZmlsZQpkYXRlZXh0CgojIHVuY29tbWVudCB0aGlzIGlmIHlvdSB3YW50IHlvdXIgbG9nIGZpbGVzIGNvbXByZXNzZWQKY29tcHJlc3MKCiMgUlBNIHBhY2thZ2VzIGRyb3AgbG9nIHJvdGF0aW9uIGluZm9ybWF0aW9uIGludG8gdGhpcyBkaXJlY3RvcnkKaW5jbHVkZSAvZXRjL2xvZ3JvdGF0ZS5kCgojIG5vIHBhY2thZ2VzIG93biB3dG1wIGFuZCBidG1wIC0tIHdlJ2xsIHJvdGF0ZSB0aGVtIGhlcmUKL3Zhci9sb2cvd3RtcCB7CiAgICBtb250aGx5CiAgICBjcmVhdGUgMDY2NCByb290IHV0bXAKICAgICAgICBtaW5zaXplIDFNCiAgICByb3RhdGUgMQp9CgovdmFyL2xvZy9idG1wIHsKICAgIG1pc3NpbmdvawogICAgbW9udGhseQogICAgY3JlYXRlIDA2MDAgcm9vdCB1dG1wCiAgICByb3RhdGUgMQp9CkVPRgoKZWNobyAiY29uZmlndXJpbmcgeXVtIHJlcG9zaXRvcnkgYW5kIHJ1bm5pbmcgeXVtIHVwZGF0ZSIKY2F0ID4vZXRjL3l1bS5yZXBvcy5kL2F6dXJlLnJlcG8gPDwnRU9GJwpbYXp1cmUtY2xpXQpuYW1lPWF6dXJlLWNsaQpiYXNldXJsPWh0dHBzOi8vcGFja2FnZXMubWljcm9zb2Z0LmNvbS95dW1yZXBvcy9henVyZS1jbGkKZW5hYmxlZD15ZXMKZ3BnY2hlY2s9eWVzCgpbYXp1cmVjb3JlXQpuYW1lPWF6dXJlY29yZQpiYXNldXJsPWh0dHBzOi8vcGFja2FnZXMubWljcm9zb2Z0LmNvbS95dW1yZXBvcy9henVyZWNvcmUKZW5hYmxlZD15ZXMKZ3BnY2hlY2s9bm8KRU9GCgpzZW1hbmFnZSBmY29udGV4dCAtYSAtdCB2YXJfbG9nX3QgIi92YXIvbG9nL2pvdXJuYWwoLy4qKT8iCm1rZGlyIC1wIC92YXIvbG9nL2pvdXJuYWwKCmZvciBhdHRlbXB0IGluIHsxLi41fTsgZG8KeXVtIC15IGluc3RhbGwgY2xhbWF2IGF6c2VjLWNsYW1hdiBhenNlYy1tb25pdG9yIGF6dXJlLWNsaSBhenVyZS1tZHNkIGF6dXJlLXNlY3VyaXR5IHBvZG1hbiBwb2RtYW4tZG9ja2VyIG9wZW5zc2wtcGVybCBweXRob24zICYmIGJyZWFrCiAgIyBoYWNrIC0gd2UgYXJlIGluc3RhbGxpbmcgcHl0aG9uMyBvbiBob3N0cyBkdWUgdG8gYW4gaXNzdWUgd2l0aCBBenVyZSBMaW51eCBFeHRlbnNpb25zIGh0dHBzOi8vZ2l0aHViLmNvbS9BenVyZS9henVyZS1saW51eC1leHRlbnNpb25zL3B1bGwvMTUwNQogIGlmIFtbICR7YXR0ZW1wdH0gLWx0IDUgXV07IHRoZW4gc2xlZXAgMTA7IGVsc2UgZXhpdCAxOyBmaQpkb25lCgojIGh0dHBzOi8vYWNjZXNzLnJlZGhhdC5jb20vc2VjdXJpdHkvY3ZlL2N2ZS0yMDIwLTEzNDAxCmVjaG8gImFwcGx5aW5nIGZpcmV3YWxsIHJ1bGVzIgpjYXQgPi9ldGMvc3lzY3RsLmQvMDItZGlzYWJsZS1hY2NlcHQtcmEuY29uZiA8PCdFT0YnCm5ldC5pcHY2LmNvbmYuYWxsLmFjY2VwdF9yYT0wCkVPRgoKY2F0ID4vZXRjL3N5c2N0bC5kLzAxLWRpc2FibGUtY29yZS5jb25mIDw8J0VPRicKa2VybmVsLmNvcmVfcGF0dGVybiA9IHwvYmluL3RydWUKRU9GCnN5c2N0bCAtLXN5c3RlbQoKZmlyZXdhbGwtY21kIC0tYWRkLXBvcnQ9NDQzL3RjcCAtLXBlcm1hbmVudApmaXJld2FsbC1jbWQgLS1hZGQtcG9ydD00NDQvdGNwIC0tcGVybWFuZW50CmZpcmV3YWxsLWNtZCAtLWFkZC1wb3J0PTQ0NS90Y3AgLS1wZXJtYW5lbnQKZmlyZXdhbGwtY21kIC0tYWRkLXBvcnQ9MjIyMi90Y3AgLS1wZXJtYW5lbnQKCmV4cG9ydCBBWlVSRV9DTE9VRF9OQU1FPSRBWlVSRUNMT1VETkFNRQoKZWNobyAibG9nZ2luZyBpbnRvIHByb2QgYWNyIgpheiBsb2dpbiAtaSAtLWFsbG93LW5vLXN1YnNjcmlwdGlvbnMKCiMgU3VwcHJlc3MgZW11bGF0aW9uIG91dHB1dCBmb3IgcG9kbWFuIGluc3RlYWQgb2YgZG9ja2VyIGZvciBheiBhY3IgY29tcGF0YWJpbGl0eQpta2RpciAtcCAvZXRjL2NvbnRhaW5lcnMvCnRvdWNoIC9ldGMvY29udGFpbmVycy9ub2RvY2tlcgoKbWtkaXIgLXAgL3Jvb3QvLmRvY2tlcgpSRUdJU1RSWV9BVVRIX0ZJTEU9L3Jvb3QvLmRvY2tlci9jb25maWcuanNvbiBheiBhY3IgbG9naW4gLS1uYW1lICIkKHNlZCAtZSAnc3wuKi98fCcgPDw8IiRBQ1JSRVNPVVJDRUlEIikiCgpNRE1JTUFHRT0iJHtSUElNQUdFJSUvKn0vJHtNRE1JTUFHRSMjKi99Igpkb2NrZXIgcHVsbCAiJE1ETUlNQUdFIgpkb2NrZXIgcHVsbCAiJFJQSU1BR0UiCmRvY2tlciBwdWxsICIkRkxVRU5UQklUSU1BR0UiCgpheiBsb2dvdXQKCmVjaG8gImNvbmZpZ3VyaW5nIGZsdWVudGJpdCBzZXJ2aWNlIgpta2RpciAtcCAvZXRjL2ZsdWVudGJpdC8KbWtkaXIgLXAgL3Zhci9saWIvZmx1ZW50CgpjYXQgPi9ldGMvZmx1ZW50Yml0L2ZsdWVudGJpdC5jb25mIDw8J0VPRicKW0lOUFVUXQoJTmFtZSBzeXN0ZW1kCglUYWcgam91cm5hbGQKCVN5c3RlbWRfRmlsdGVyIF9DT01NPWFybwoJREIgL3Zhci9saWIvZmx1ZW50L2pvdXJuYWxkYgoKW0ZJTFRFUl0KCU5hbWUgbW9kaWZ5CglNYXRjaCBqb3VybmFsZAoJUmVtb3ZlX3dpbGRjYXJkIF8KCVJlbW92ZSBUSU1FU1RBTVAKCltGSUxURVJdCglOYW1lIHJld3JpdGVfdGFnCglNYXRjaCBqb3VybmFsZAoJUnVsZSAkTE9HS0lORCBhc3luY3FvcyBhc3luY3FvcyB0cnVlCgpbRklMVEVSXQoJTmFtZSBtb2RpZnkKCU1hdGNoIGFzeW5jcW9zCglSZW1vdmUgQ0xJRU5UX1BSSU5DSVBBTF9OQU1FCglSZW1vdmUgRklMRQoJUmVtb3ZlIENPTVBPTkVOVAoKW0ZJTFRFUl0KCU5hbWUgcmV3cml0ZV90YWcKCU1hdGNoIGpvdXJuYWxkCglSdWxlICRMT0dLSU5EIGlmeGF1ZGl0IGlmeGF1ZGl0IGZhbHNlCgpbT1VUUFVUXQoJTmFtZSBmb3J3YXJkCglNYXRjaCAqCglQb3J0IDI5MjMwCkVPRgoKZWNobyAiRkxVRU5UQklUSU1BR0U9JEZMVUVOVEJJVElNQUdFIiA+L2V0Yy9zeXNjb25maWcvZmx1ZW50Yml0CgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vZmx1ZW50Yml0LnNlcnZpY2UgPDwnRU9GJwpbVW5pdF0KQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldApTdGFydExpbWl0SW50ZXJ2YWxTZWM9MAoKW1NlcnZpY2VdClJlc3RhcnRTZWM9MXMKRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2ZsdWVudGJpdApFeGVjU3RhcnRQcmU9LS91c3IvYmluL2RvY2tlciBybSAtZiAlTgpFeGVjU3RhcnQ9L3Vzci9iaW4vZG9ja2VyIHJ1biBcCiAgLS1zZWN1cml0eS1vcHQgbGFiZWw9ZGlzYWJsZSBcCiAgLS1lbnRyeXBvaW50IC9vcHQvdGQtYWdlbnQtYml0L2Jpbi90ZC1hZ2VudC1iaXQgXAogIC0tbmV0PWhvc3QgXAogIC0taG9zdG5hbWUgJUggXAogIC0tbmFtZSAlTiBcCiAgLS1ybSBcCiAgLS1jYXAtZHJvcCBuZXRfcmF3IFwKICAtdiAvZXRjL2ZsdWVudGJpdC9mbHVlbnRiaXQuY29uZjovZXRjL2ZsdWVudGJpdC9mbHVlbnRiaXQuY29uZiBcCiAgLXYgL3Zhci9saWIvZmx1ZW50Oi92YXIvbGliL2ZsdWVudDp6IFwKICAtdiAvdmFyL2xvZy9qb3VybmFsOi92YXIvbG9nL2pvdXJuYWw6cm8gXAogIC12IC9ldGMvbWFjaGluZS1pZDovZXRjL21hY2hpbmUtaWQ6cm8gXAogICRGTFVFTlRCSVRJTUFHRSBcCiAgLWMgL2V0Yy9mbHVlbnRiaXQvZmx1ZW50Yml0LmNvbmYKCkV4ZWNTdG9wPS91c3IvYmluL2RvY2tlciBzdG9wICVOClJlc3RhcnQ9YWx3YXlzClJlc3RhcnRTZWM9NQpTdGFydExpbWl0SW50ZXJ2YWw9MAoKW0luc3RhbGxdCldhbnRlZEJ5PW11bHRpLXVzZXIudGFyZ2V0CkVPRgoKbWtkaXIgL2V0Yy9hcm8tcnAKYmFzZTY0IC1kIDw8PCIkQURNSU5BUElDQUJVTkRMRSIgPi9ldGMvYXJvLXJwL2FkbWluLWNhLWJ1bmRsZS5wZW0KaWYgW1sgLW4gIiRBUk1BUElDQUJVTkRMRSIgXV07IHRoZW4KICBiYXNlNjQgLWQgPDw8IiRBUk1BUElDQUJVTkRMRSIgPi9ldGMvYXJvLXJwL2FybS1jYS1idW5kbGUucGVtCmZpCmNob3duIC1SIDEwMDA6MTAwMCAvZXRjL2Fyby1ycAoKZWNobyAiY29uZmlndXJpbmcgbWRtIHNlcnZpY2UiCmNhdCA+L2V0Yy9zeXNjb25maWcvbWRtIDw8RU9GCk1ETUZST05URU5EVVJMPSckTURNRlJPTlRFTkRVUkwnCk1ETUlNQUdFPSckTURNSU1BR0UnCk1ETVNPVVJDRUVOVklST05NRU5UPSckTE9DQVRJT04nCk1ETVNPVVJDRVJPTEU9cnAKTURNU09VUkNFUk9MRUlOU1RBTkNFPSckKGhvc3RuYW1lKScKRU9GCgpta2RpciAvdmFyL2V0dwpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vbWRtLnNlcnZpY2UgPDwnRU9GJwpbVW5pdF0KQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldAoKW1NlcnZpY2VdCkVudmlyb25tZW50RmlsZT0vZXRjL3N5c2NvbmZpZy9tZG0KRXhlY1N0YXJ0UHJlPS0vdXNyL2Jpbi9kb2NrZXIgcm0gLWYgJU4KRXhlY1N0YXJ0PS91c3IvYmluL2RvY2tlciBydW4gXAogIC0tZW50cnlwb2ludCAvdXNyL3NiaW4vTWV0cmljc0V4dGVuc2lvbiBcCiAgLS1ob3N0bmFtZSAlSCBcCiAgLS1uYW1lICVOIFwKICAtLXJtIFwKICAtLWNhcC1kcm9wIG5ldF9yYXcgXAogIC1tIDJnIFwKICAtdiAvZXRjL21kbS5wZW06L2V0Yy9tZG0ucGVtIFwKICAtdiAvdmFyL2V0dzovdmFyL2V0dzp6IFwKICAkTURNSU1BR0UgXAogIC1DZXJ0RmlsZSAvZXRjL21kbS5wZW0gXAogIC1Gcm9udEVuZFVybCAkTURNRlJPTlRFTkRVUkwgXAogIC1Mb2dnZXIgQ29uc29sZSBcCiAgLUxvZ0xldmVsIFdhcm5pbmcgXAogIC1Qcml2YXRlS2V5RmlsZSAvZXRjL21kbS5wZW0gXAogIC1Tb3VyY2VFbnZpcm9ubWVudCAkTURNU09VUkNFRU5WSVJPTk1FTlQgXAogIC1Tb3VyY2VSb2xlICRNRE1TT1VSQ0VST0xFIFwKICAtU291cmNlUm9sZUluc3RhbmNlICRNRE1TT1VSQ0VST0xFSU5TVEFOQ0UKRXhlY1N0b3A9L3Vzci9iaW4vZG9ja2VyIHN0b3AgJU4KUmVzdGFydD1hbHdheXMKUmVzdGFydFNlYz0xClN0YXJ0TGltaXRJbnRlcnZhbD0wCgpbSW5zdGFsbF0KV2FudGVkQnk9bXVsdGktdXNlci50YXJnZXQKRU9GCgplY2hvICJjb25maWd1cmluZyBhcm8tcnAgc2VydmljZSIKY2F0ID4vZXRjL3N5c2NvbmZpZy9hcm8tcnAgPDxFT0YKQUNSX1JFU09VUkNFX0lEPSckQUNSUkVTT1VSQ0VJRCcKQURNSU5fQVBJX0NMSUVOVF9DRVJUX0NPTU1PTl9OQU1FPSckQURNSU5BUElDTElFTlRDRVJUQ09NTU9OTkFNRScKQVJNX0FQSV9DTElFTlRfQ0VSVF9DT01NT05fTkFNRT0nJEFSTUFQSUNMSUVOVENFUlRDT01NT05OQU1FJwpBWlVSRV9BUk1fQ0xJRU5UX0lEPSckQVJNQ0xJRU5USUQnCkFaVVJFX0ZQX0NMSUVOVF9JRD0nJEZQQ0xJRU5USUQnCkFaVVJFX0ZQX1NFUlZJQ0VfUFJJTkNJUEFMX0lEPSckRlBTRVJWSUNFUFJJTkNJUEFMSUQnCkJJTExJTkdfRTJFX1NUT1JBR0VfQUNDT1VOVF9JRD0nJEJJTExJTkdFMkVTVE9SQUdFQUNDT1VOVElEJwpDTFVTVEVSX01ETV9BQ0NPVU5UPSckQ0xVU1RFUk1ETUFDQ09VTlQnCkNMVVNURVJfTURNX05BTUVTUEFDRT1SUApDTFVTVEVSX01EU0RfQUNDT1VOVD0nJENMVVNURVJNRFNEQUNDT1VOVCcKQ0xVU1RFUl9NRFNEX0NPTkZJR19WRVJTSU9OPSckQ0xVU1RFUk1EU0RDT05GSUdWRVJTSU9OJwpDTFVTVEVSX01EU0RfTkFNRVNQQUNFPSckQ0xVU1RFUk1EU0ROQU1FU1BBQ0UnCkRBVEFCQVNFX0FDQ09VTlRfTkFNRT0nJERBVEFCQVNFQUNDT1VOVE5BTUUnCkRPTUFJTl9OQU1FPSckTE9DQVRJT04uJENMVVNURVJQQVJFTlRET01BSU5OQU1FJwpHQVRFV0FZX0RPTUFJTlM9JyRHQVRFV0FZRE9NQUlOUycKR0FURVdBWV9SRVNPVVJDRUdST1VQPSckR0FURVdBWVJFU09VUkNFR1JPVVBOQU1FJwpLRVlWQVVMVF9QUkVGSVg9JyRLRVlWQVVMVFBSRUZJWCcKTURNX0FDQ09VTlQ9JyRSUE1ETUFDQ09VTlQnCk1ETV9OQU1FU1BBQ0U9UlAKTURTRF9FTlZJUk9OTUVOVD0nJE1EU0RFTlZJUk9OTUVOVCcKUlBfRkVBVFVSRVM9JyRSUEZFQVRVUkVTJwpSUElNQUdFPSckUlBJTUFHRScKQVJPX0lOU1RBTExfVklBX0hJVkU9JyRDTFVTVEVSU0lOU1RBTExWSUFISVZFJwpBUk9fSElWRV9ERUZBVUxUX0lOU1RBTExFUl9QVUxMU1BFQz0nJENMVVNURVJERUZBVUxUSU5TVEFMTEVSUFVMTFNQRUMnCkFST19BRE9QVF9CWV9ISVZFPSckQ0xVU1RFUlNBRE9QVEJZSElWRScKVVNFX0NIRUNLQUNDRVNTPSckVVNFQ0hFQ0tBQ0NFU1MnCkVPRgoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL2Fyby1ycC5zZXJ2aWNlIDw8J0VPRicKW1VuaXRdCkFmdGVyPW5ldHdvcmstb25saW5lLnRhcmdldApXYW50cz1uZXR3b3JrLW9ubGluZS50YXJnZXQKCltTZXJ2aWNlXQpFbnZpcm9ubWVudEZpbGU9L2V0Yy9zeXNjb25maWcvYXJvLXJwCkV4ZWNTdGFydFByZT0tL3Vzci9iaW4vZG9ja2VyIHJtIC1mICVOCkV4ZWNTdGFydD0vdXNyL2Jpbi9kb2NrZXIgcnVuIFwKICAtLWhvc3RuYW1lICVIIFwKICAtLW5hbWUgJU4gXAogIC0tcm0gXAogIC0tY2FwLWRyb3AgbmV0X3JhdyBcCiAgLWUgQUNSX1JFU09VUkNFX0lEIFwKICAtZSBBRE1JTl9BUElfQ0xJRU5UX0NFUlRfQ09NTU9OX05BTUUgXAogIC1lIEFSTV9BUElfQ0xJRU5UX0NFUlRfQ09NTU9OX05BTUUgXAogIC1lIEFaVVJFX0FSTV9DTElFTlRfSUQgXAogIC1lIEFaVVJFX0ZQX0NMSUVOVF9JRCBcCiAgLWUgQklMTElOR19FMkVfU1RPUkFHRV9BQ0NPVU5UX0lEIFwKICAtZSBDTFVTVEVSX01ETV9BQ0NPVU5UIFwKICAtZSBDTFVTVEVSX01ETV9OQU1FU1BBQ0UgXAogIC1lIENMVVNURVJfTURTRF9BQ0NPVU5UIFwKICAtZSBDTFVTVEVSX01EU0RfQ09ORklHX1ZFUlNJT04gXAogIC1lIENMVVNURVJfTURTRF9OQU1FU1BBQ0UgXAogIC1lIERBVEFCQVNFX0FDQ09VTlRfTkFNRSBcCiAgLWUgRE9NQUlOX05BTUUgXAogIC1lIEdBVEVXQVlfRE9NQUlOUyBcCiAgLWUgR0FURVdBWV9SRVNPVVJDRUdST1VQIFwKICAtZSBLRVlWQVVMVF9QUkVGSVggXAogIC1lIE1ETV9BQ0NPVU5UIFwKICAtZSBNRE1fTkFNRVNQQUNFIFwKICAtZSBNRFNEX0VOVklST05NRU5UIFwKICAtZSBSUF9GRUFUVVJFUyBcCiAgLWUgQVJPX0lOU1RBTExfVklBX0hJVkUgXAogIC1lIEFST19ISVZFX0RFRkFVTFRfSU5TVEFMTEVSX1BVTExTUEVDIFwKICAtZSBBUk9fQURPUFRfQllfSElWRSBcCiAgLWUgVVNFX0NIRUNLQUNDRVNTIFwKICAtbSAyZyBcCiAgLXAgNDQzOjg0NDMgXAogIC12IC9ldGMvYXJvLXJwOi9ldGMvYXJvLXJwIFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIHJwCkV4ZWNTdG9wPS91c3IvYmluL2RvY2tlciBzdG9wIC10IDM2MDAgJU4KVGltZW91dFN0b3BTZWM9MzYwMApSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKU3RhcnRMaW1pdEludGVydmFsPTAKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIGFyby1kYnRva2VuIHNlcnZpY2UiCmNhdCA+L2V0Yy9zeXNjb25maWcvYXJvLWRidG9rZW4gPDxFT0YKREFUQUJBU0VfQUNDT1VOVF9OQU1FPSckREFUQUJBU0VBQ0NPVU5UTkFNRScKQVpVUkVfREJUT0tFTl9DTElFTlRfSUQ9JyREQlRPS0VOQ0xJRU5USUQnCkFaVVJFX0dBVEVXQVlfU0VSVklDRV9QUklOQ0lQQUxfSUQ9JyRHQVRFV0FZU0VSVklDRVBSSU5DSVBBTElEJwpLRVlWQVVMVF9QUkVGSVg9JyRLRVlWQVVMVFBSRUZJWCcKTURNX0FDQ09VTlQ9JyRSUE1ETUFDQ09VTlQnCk1ETV9OQU1FU1BBQ0U9REJUb2tlbgpSUElNQUdFPSckUlBJTUFHRScKRU9GCgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vYXJvLWRidG9rZW4uc2VydmljZSA8PCdFT0YnCltVbml0XQpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKV2FudHM9bmV0d29yay1vbmxpbmUudGFyZ2V0CgpbU2VydmljZV0KRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2Fyby1kYnRva2VuCkV4ZWNTdGFydFByZT0tL3Vzci9iaW4vZG9ja2VyIHJtIC1mICVOCkV4ZWNTdGFydD0vdXNyL2Jpbi9kb2NrZXIgcnVuIFwKICAtLWhvc3RuYW1lICVIIFwKICAtLW5hbWUgJU4gXAogIC0tcm0gXAogIC0tY2FwLWRyb3AgbmV0X3JhdyBcCiAgLWUgQVpVUkVfR0FURVdBWV9TRVJWSUNFX1BSSU5DSVBBTF9JRCBcCiAgLWUgREFUQUJBU0VfQUNDT1VOVF9OQU1FIFwKICAtZSBBWlVSRV9EQlRPS0VOX0NMSUVOVF9JRCBcCiAgLWUgS0VZVkFVTFRfUFJFRklYIFwKICAtZSBNRE1fQUNDT1VOVCBcCiAgLWUgTURNX05BTUVTUEFDRSBcCiAgLW0gMmcgXAogIC1wIDQ0NTo4NDQ1IFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIGRidG9rZW4KRXhlY1N0b3A9L3Vzci9iaW4vZG9ja2VyIHN0b3AgLXQgMzYwMCAlTgpUaW1lb3V0U3RvcFNlYz0zNjAwClJlc3RhcnQ9YWx3YXlzClJlc3RhcnRTZWM9MQpTdGFydExpbWl0SW50ZXJ2YWw9MAoKW0luc3RhbGxdCldhbnRlZEJ5PW11bHRpLXVzZXIudGFyZ2V0CkVPRgoKZWNobyAiY29uZmlndXJpbmcgYXJvLW1vbml0b3Igc2VydmljZSIKY2F0ID4vZXRjL3N5c2NvbmZpZy9hcm8tbW9uaXRvciA8PEVPRgpDTFVTVEVSX01ETV9BQ0NPVU5UPSckQ0xVU1RFUk1ETUFDQ09VTlQnCkNMVVNURVJfTURNX05BTUVTUEFDRT1CQk0KREFUQUJBU0VfQUNDT1VOVF9OQU1FPSckREFUQUJBU0VBQ0NPVU5UTkFNRScKS0VZVkFVTFRfUFJFRklYPSckS0VZVkFVTFRQUkVGSVgnCk1ETV9BQ0NPVU5UPSckUlBNRE1BQ0NPVU5UJwpNRE1fTkFNRVNQQUNFPUJCTQpSUElNQUdFPSckUlBJTUFHRScKRU9GCgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vYXJvLW1vbml0b3Iuc2VydmljZSA8PCdFT0YnCltVbml0XQpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKV2FudHM9bmV0d29yay1vbmxpbmUudGFyZ2V0CgpbU2VydmljZV0KRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2Fyby1tb25pdG9yCkV4ZWNTdGFydFByZT0tL3Vzci9iaW4vZG9ja2VyIHJtIC1mICVOCkV4ZWNTdGFydD0vdXNyL2Jpbi9kb2NrZXIgcnVuIFwKICAtLWhvc3RuYW1lICVIIFwKICAtLW5hbWUgJU4gXAogIC0tcm0gXAogIC0tY2FwLWRyb3AgbmV0X3JhdyBcCiAgLWUgQ0xVU1RFUl9NRE1fQUNDT1VOVCBcCiAgLWUgQ0xVU1RFUl9NRE1fTkFNRVNQQUNFIFwKICAtZSBEQVRBQkFTRV9BQ0NPVU5UX05BTUUgXAogIC1lIEtFWVZBVUxUX1BSRUZJWCBcCiAgLWUgTURNX0FDQ09VTlQgXAogIC1lIE1ETV9OQU1FU1BBQ0UgXAogIC1tIDIuNWcgXAogIC12IC9ydW4vc3lzdGVtZC9qb3VybmFsOi9ydW4vc3lzdGVtZC9qb3VybmFsIFwKICAtdiAvdmFyL2V0dzovdmFyL2V0dzp6IFwKICAkUlBJTUFHRSBcCiAgbW9uaXRvcgpSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKU3RhcnRMaW1pdEludGVydmFsPTAKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIGFyby1wb3J0YWwgc2VydmljZSIKY2F0ID4vZXRjL3N5c2NvbmZpZy9hcm8tcG9ydGFsIDw8RU9GCkFaVVJFX1BPUlRBTF9BQ0NFU1NfR1JPVVBfSURTPSckUE9SVEFMQUNDRVNTR1JPVVBJRFMnCkFaVVJFX1BPUlRBTF9DTElFTlRfSUQ9JyRQT1JUQUxDTElFTlRJRCcKQVpVUkVfUE9SVEFMX0VMRVZBVEVEX0dST1VQX0lEUz0nJFBPUlRBTEVMRVZBVEVER1JPVVBJRFMnCkRBVEFCQVNFX0FDQ09VTlRfTkFNRT0nJERBVEFCQVNFQUNDT1VOVE5BTUUnCktFWVZBVUxUX1BSRUZJWD0nJEtFWVZBVUxUUFJFRklYJwpNRE1fQUNDT1VOVD0nJFJQTURNQUNDT1VOVCcKTURNX05BTUVTUEFDRT1Qb3J0YWwKUE9SVEFMX0hPU1ROQU1FPSckTE9DQVRJT04uYWRtaW4uJFJQUEFSRU5URE9NQUlOTkFNRScKUlBJTUFHRT0nJFJQSU1BR0UnCkVPRgoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL2Fyby1wb3J0YWwuc2VydmljZSA8PCdFT0YnCltVbml0XQpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKV2FudHM9bmV0d29yay1vbmxpbmUudGFyZ2V0ClN0YXJ0TGltaXRJbnRlcnZhbD0wCgpbU2VydmljZV0KRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2Fyby1wb3J0YWwKRXhlY1N0YXJ0UHJlPS0vdXNyL2Jpbi9kb2NrZXIgcm0gLWYgJU4KRXhlY1N0YXJ0PS91c3IvYmluL2RvY2tlciBydW4gXAogIC0taG9zdG5hbWUgJUggXAogIC0tbmFtZSAlTiBcCiAgLS1ybSBcCiAgLS1jYXAtZHJvcCBuZXRfcmF3IFwKICAtZSBBWlVSRV9QT1JUQUxfQUNDRVNTX0dST1VQX0lEUyBcCiAgLWUgQVpVUkVfUE9SVEFMX0NMSUVOVF9JRCBcCiAgLWUgQVpVUkVfUE9SVEFMX0VMRVZBVEVEX0dST1VQX0lEUyBcCiAgLWUgREFUQUJBU0VfQUNDT1VOVF9OQU1FIFwKICAtZSBLRVlWQVVMVF9QUkVGSVggXAogIC1lIE1ETV9BQ0NPVU5UIFwKICAtZSBNRE1fTkFNRVNQQUNFIFwKICAtZSBQT1JUQUxfSE9TVE5BTUUgXAogIC1tIDJnIFwKICAtcCA0NDQ6ODQ0NCBcCiAgLXAgMjIyMjoyMjIyIFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIHBvcnRhbApSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIG1kc2QgYW5kIG1kbSBzZXJ2aWNlcyIKY2hjb24gLVIgc3lzdGVtX3U6b2JqZWN0X3I6dmFyX2xvZ190OnMwIC92YXIvb3B0L21pY3Jvc29mdC9saW51eG1vbmFnZW50Cgpta2RpciAtcCAvdmFyL2xpYi93YWFnZW50L01pY3Jvc29mdC5BenVyZS5LZXlWYXVsdC5TdG9yZQoKZm9yIHZhciBpbiAibWRzZCIgIm1kbSI7IGRvCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9kb3dubG9hZC0kdmFyLWNyZWRlbnRpYWxzLnNlcnZpY2UgPDxFT0YKW1VuaXRdCkRlc2NyaXB0aW9uPVBlcmlvZGljICR2YXIgY3JlZGVudGlhbHMgcmVmcmVzaAoKW1NlcnZpY2VdClR5cGU9b25lc2hvdApFeGVjU3RhcnQ9L3Vzci9sb2NhbC9iaW4vZG93bmxvYWQtY3JlZGVudGlhbHMuc2ggJHZhcgpFT0YKCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9kb3dubG9hZC0kdmFyLWNyZWRlbnRpYWxzLnRpbWVyIDw8RU9GCltVbml0XQpEZXNjcmlwdGlvbj1QZXJpb2RpYyAkdmFyIGNyZWRlbnRpYWxzIHJlZnJlc2gKQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldAoKW1RpbWVyXQpPbkJvb3RTZWM9MG1pbgpPbkNhbGVuZGFyPTAvMTI6MDA6MDAKQWNjdXJhY3lTZWM9NXMKCltJbnN0YWxsXQpXYW50ZWRCeT10aW1lcnMudGFyZ2V0CkVPRgpkb25lCgpjYXQgPi91c3IvbG9jYWwvYmluL2Rvd25sb2FkLWNyZWRlbnRpYWxzLnNoIDw8RU9GCiMhL2Jpbi9iYXNoCnNldCAtZXUKCkNPTVBPTkVOVD0iXCQxIgplY2hvICJEb3dubG9hZCBcJENPTVBPTkVOVCBjcmVkZW50aWFscyIKClRFTVBfRElSPVwkKG1rdGVtcCAtZCkKZXhwb3J0IEFaVVJFX0NPTkZJR19ESVI9XCQobWt0ZW1wIC1kKQoKZWNobyAiTG9nZ2luZyBpbnRvIEF6dXJlLi4uIgpSRVRSSUVTPTMKd2hpbGUgWyAiXCRSRVRSSUVTIiAtZ3QgMCBdOyBkbwogICAgaWYgYXogbG9naW4gLWkgLS1hbGxvdy1uby1zdWJzY3JpcHRpb25zCiAgICB0aGVuCiAgICAgICAgZWNobyAiYXogbG9naW4gc3VjY2Vzc2Z1bCIKICAgICAgICBicmVhawogICAgZWxzZQogICAgICAgIGVjaG8gImF6IGxvZ2luIGZhaWxlZC4gUmV0cnlpbmcuLi4iCiAgICAgICAgbGV0IFJFVFJJRVMtPTEKICAgICAgICBzbGVlcCA1CiAgICBmaQpkb25lCgp0cmFwICJjbGVhbnVwIiBFWElUCgpjbGVhbnVwKCkgewogIGF6IGxvZ291dAogIFtbICJcJFRFTVBfRElSIiA9fiAvdG1wLy4rIF1dICYmIHJtIC1yZiBcJFRFTVBfRElSCiAgW1sgIlwkQVpVUkVfQ09ORklHX0RJUiIgPX4gL3RtcC8uKyBdXSAmJiBybSAtcmYgXCRBWlVSRV9DT05GSUdfRElSCn0KCmlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZG0iIF07IHRoZW4KICBDVVJSRU5UX0NFUlRfRklMRT0iL2V0Yy9tZG0ucGVtIgplbGlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZHNkIiBdOyB0aGVuCiAgQ1VSUkVOVF9DRVJUX0ZJTEU9Ii92YXIvbGliL3dhYWdlbnQvTWljcm9zb2Z0LkF6dXJlLktleVZhdWx0LlN0b3JlL21kc2QucGVtIgplbHNlCiAgZWNobyBJbnZhbGlkIHVzYWdlICYmIGV4aXQgMQpmaQoKU0VDUkVUX05BTUU9InJwLVwke0NPTVBPTkVOVH0iCk5FV19DRVJUX0ZJTEU9IlwkVEVNUF9ESVIvXCRDT01QT05FTlQucGVtIgpmb3IgYXR0ZW1wdCBpbiB7MS4uNX07IGRvCiAgYXoga2V5dmF1bHQgc2VjcmV0IGRvd25sb2FkIC0tZmlsZSBcJE5FV19DRVJUX0ZJTEUgLS1pZCAiaHR0cHM6Ly8kS0VZVkFVTFRQUkVGSVgtc3ZjLiRLRVlWQVVMVEROU1NVRkZJWC9zZWNyZXRzL1wkU0VDUkVUX05BTUUiICYmIGJyZWFrCiAgaWYgW1sgXCRhdHRlbXB0IC1sdCA1IF1dOyB0aGVuIHNsZWVwIDEwOyBlbHNlIGV4aXQgMTsgZmkKZG9uZQoKaWYgWyAtZiBcJE5FV19DRVJUX0ZJTEUgXTsgdGhlbgogIGlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZHNkIiBdOyB0aGVuCiAgICBjaG93biBzeXNsb2c6c3lzbG9nIFwkTkVXX0NFUlRfRklMRQogIGVsc2UKICAgIHNlZCAtaSAtbmUgJzEsL0VORCBDRVJUSUZJQ0FURS8gcCcgXCRORVdfQ0VSVF9GSUxFCiAgZmkKICBpZiAhIGRpZmYgJE5FV19DRVJUX0ZJTEUgJENVUlJFTlRfQ0VSVF9GSUxFID4vZGV2L251bGwgMj4mMTsgdGhlbgogICAgY2htb2QgMDYwMCBcJE5FV19DRVJUX0ZJTEUKICAgIG12IFwkTkVXX0NFUlRfRklMRSBcJENVUlJFTlRfQ0VSVF9GSUxFCiAgZmkKZWxzZQogIGVjaG8gRmFpbGVkIHRvIHJlZnJlc2ggY2VydGlmaWNhdGUgZm9yIFwkQ09NUE9ORU5UICYmIGV4aXQgMQpmaQpFT0YKCmNobW9kIHUreCAvdXNyL2xvY2FsL2Jpbi9kb3dubG9hZC1jcmVkZW50aWFscy5zaAoKc3lzdGVtY3RsIGVuYWJsZSBkb3dubG9hZC1tZHNkLWNyZWRlbnRpYWxzLnRpbWVyCnN5c3RlbWN0bCBlbmFibGUgZG93bmxvYWQtbWRtLWNyZWRlbnRpYWxzLnRpbWVyCgovdXNyL2xvY2FsL2Jpbi9kb3dubG9hZC1jcmVkZW50aWFscy5zaCBtZHNkCi91c3IvbG9jYWwvYmluL2Rvd25sb2FkLWNyZWRlbnRpYWxzLnNoIG1kbQpNRFNEQ0VSVElGSUNBVEVTQU49JChvcGVuc3NsIHg1MDkgLWluIC92YXIvbGliL3dhYWdlbnQvTWljcm9zb2Z0LkF6dXJlLktleVZhdWx0LlN0b3JlL21kc2QucGVtIC1ub291dCAtc3ViamVjdCB8IHNlZCAtZSAncy8uKkNOID0gLy8nKQoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL3dhdGNoLW1kbS1jcmVkZW50aWFscy5zZXJ2aWNlIDw8RU9GCltVbml0XQpEZXNjcmlwdGlvbj1XYXRjaCBmb3IgY2hhbmdlcyBpbiBtZG0ucGVtIGFuZCByZXN0YXJ0cyB0aGUgbWRtIHNlcnZpY2UKCltTZXJ2aWNlXQpUeXBlPW9uZXNob3QKRXhlY1N0YXJ0PS91c3IvYmluL3N5c3RlbWN0bCByZXN0YXJ0IG1kbS5zZXJ2aWNlCgpbSW5zdGFsbF0KV2FudGVkQnk9bXVsdGktdXNlci50YXJnZXQKRU9GCgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vd2F0Y2gtbWRtLWNyZWRlbnRpYWxzLnBhdGggPDxFT0YKW1BhdGhdClBhdGhNb2RpZmllZD0vZXRjL21kbS5wZW0KCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCnN5c3RlbWN0bCBlbmFibGUgd2F0Y2gtbWRtLWNyZWRlbnRpYWxzLnBhdGgKc3lzdGVtY3RsIHN0YXJ0IHdhdGNoLW1kbS1jcmVkZW50aWFscy5wYXRoCgpta2RpciAvZXRjL3N5c3RlbWQvc3lzdGVtL21kc2Quc2VydmljZS5kCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9tZHNkLnNlcnZpY2UuZC9vdmVycmlkZS5jb25mIDw8J0VPRicKW1VuaXRdCkFmdGVyPW5ldHdvcmstb25saW5lLnRhcmdldApFT0YKCmNhdCA+L2V0Yy9kZWZhdWx0L21kc2QgPDxFT0YKTURTRF9ST0xFX1BSRUZJWD0vdmFyL3J1bi9tZHNkL2RlZmF1bHQKTURTRF9PUFRJT05TPSItQSAtZCAtciBcJE1EU0RfUk9MRV9QUkVGSVgiCgpleHBvcnQgTU9OSVRPUklOR19HQ1NfRU5WSVJPTk1FTlQ9JyRNRFNERU5WSVJPTk1FTlQnCmV4cG9ydCBNT05JVE9SSU5HX0dDU19BQ0NPVU5UPSckUlBNRFNEQUNDT1VOVCcKZXhwb3J0IE1PTklUT1JJTkdfR0NTX1JFR0lPTj0nJExPQ0FUSU9OJwpleHBvcnQgTU9OSVRPUklOR19HQ1NfQVVUSF9JRF9UWVBFPUF1dGhLZXlWYXVsdApleHBvcnQgTU9OSVRPUklOR19HQ1NfQVVUSF9JRD0nJE1EU0RDRVJUSUZJQ0FURVNBTicKZXhwb3J0IE1PTklUT1JJTkdfR0NTX05BTUVTUEFDRT0nJFJQTURTRE5BTUVTUEFDRScKZXhwb3J0IE1PTklUT1JJTkdfQ09ORklHX1ZFUlNJT049JyRSUE1EU0RDT05GSUdWRVJTSU9OJwpleHBvcnQgTU9OSVRPUklOR19VU0VfR0VORVZBX0NPTkZJR19TRVJWSUNFPXRydWUKCmV4cG9ydCBNT05JVE9SSU5HX1RFTkFOVD0nJExPQ0FUSU9OJwpleHBvcnQgTU9OSVRPUklOR19ST0xFPXJwCmV4cG9ydCBNT05JVE9SSU5HX1JPTEVfSU5TVEFOQ0U9JyQoaG9zdG5hbWUpJwoKZXhwb3J0IE1EU0RfTVNHUEFDS19TT1JUX0NPTFVNTlM9MQpFT0YKCiMgc2V0dGluZyBNT05JVE9SSU5HX0dDU19BVVRIX0lEX1RZUEU9QXV0aEtleVZhdWx0IHNlZW1zIHRvIGhhdmUgY2F1c2VkIG1kc2Qgbm90CiMgdG8gaG9ub3VyIFNTTF9DRVJUX0ZJTEUgYW55IG1vcmUsIGhlYXZlbiBvbmx5IGtub3dzIHdoeS4KbWtkaXIgLXAgL3Vzci9saWIvc3NsL2NlcnRzCmNzcGxpdCAtZiAvdXNyL2xpYi9zc2wvY2VydHMvY2VydC0gLWIgJTAzZC5wZW0gL2V0Yy9wa2kvdGxzL2NlcnRzL2NhLWJ1bmRsZS5jcnQgL14kLzEgeyp9ID4vZGV2L251bGwKY19yZWhhc2ggL3Vzci9saWIvc3NsL2NlcnRzCgojIHdlIGxlYXZlIGNsaWVudElkIGJsYW5rIGFzIGxvbmcgYXMgb25seSAxIG1hbmFnZWQgaWRlbnRpdHkgYXNzaWduZWQgdG8gdm1zcwojIGlmIHdlIGhhdmUgbW9yZSB0aGFuIDEsIHdlIHdpbGwgbmVlZCB0byBwb3B1bGF0ZSB3aXRoIGNsaWVudElkIHVzZWQgZm9yIG9mZi1ub2RlIHNjYW5uaW5nCmNhdCA+L2V0Yy9kZWZhdWx0L3ZzYS1ub2Rlc2Nhbi1hZ2VudC5jb25maWcgPDxFT0YKewogICAgIk5pY2UiOiAxOSwKICAgICJUaW1lb3V0IjogMTA4MDAsCiAgICAiQ2xpZW50SWQiOiAiIiwKICAgICJUZW5hbnRJZCI6ICIkQVpVUkVTRUNQQUNLVlNBVEVOQU5USUQiLAogICAgIlF1YWx5c1N0b3JlQmFzZVVybCI6ICIkQVpVUkVTRUNQQUNLUVVBTFlTVVJMIiwKICAgICJQcm9jZXNzVGltZW91dCI6IDMwMCwKICAgICJDb21tYW5kRGVsYXkiOiAwCiAgfQpFT0YKCmVjaG8gImVuYWJsaW5nIGFybyBzZXJ2aWNlcyIKZm9yIHNlcnZpY2UgaW4gYXJvLWRidG9rZW4gYXJvLW1vbml0b3IgYXJvLXBvcnRhbCBhcm8tcnAgYXVvbXMgYXpzZWNkIGF6c2VjbW9uZCBtZHNkIG1kbSBjaHJvbnlkIGZsdWVudGJpdDsgZG8KICBzeXN0ZW1jdGwgZW5hYmxlICRzZXJ2aWNlLnNlcnZpY2UKZG9uZQoKZm9yIHNjYW4gaW4gYmFzZWxpbmUgY2xhbWF2IHNvZnR3YXJlOyBkbwogIC91c3IvbG9jYWwvYmluL2F6c2VjZCBjb25maWcgLXMgJHNjYW4gLWQgUDFECmRvbmUKCmVjaG8gInJlYm9vdGluZyIKcmVzdG9yZWNvbiAtUkYgL3Zhci9sb2cvKgooc2xlZXAgMzA7IHJlYm9vdCkgJgo=')))]" + "script": "[base64(concat(base64ToString('c2V0IC1leAoK'),'ACRRESOURCEID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('acrResourceId')),''')\n','ADMINAPICLIENTCERTCOMMONNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('adminApiClientCertCommonName')),''')\n','ARMAPICLIENTCERTCOMMONNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('armApiClientCertCommonName')),''')\n','ARMCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('armClientId')),''')\n','AZURECLOUDNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureCloudName')),''')\n','AZURESECPACKQUALYSURL=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureSecPackQualysUrl')),''')\n','AZURESECPACKVSATENANTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('azureSecPackVSATenantId')),''')\n','BILLINGE2ESTORAGEACCOUNTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('billingE2EStorageAccountId')),''')\n','CLUSTERMDMACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdmAccount')),''')\n','CLUSTERMDSDACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdAccount')),''')\n','CLUSTERMDSDCONFIGVERSION=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdConfigVersion')),''')\n','CLUSTERMDSDNAMESPACE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterMdsdNamespace')),''')\n','CLUSTERPARENTDOMAINNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterParentDomainName')),''')\n','DATABASEACCOUNTNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('databaseAccountName')),''')\n','DBTOKENCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('dbtokenClientId')),''')\n','FLUENTBITIMAGE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fluentbitImage')),''')\n','FPCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fpClientId')),''')\n','FPSERVICEPRINCIPALID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('fpServicePrincipalId')),''')\n','GATEWAYDOMAINS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayDomains')),''')\n','GATEWAYRESOURCEGROUPNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayResourceGroupName')),''')\n','GATEWAYSERVICEPRINCIPALID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('gatewayServicePrincipalId')),''')\n','KEYVAULTDNSSUFFIX=$(base64 -d \u003c\u003c\u003c''',base64(parameters('keyvaultDNSSuffix')),''')\n','KEYVAULTPREFIX=$(base64 -d \u003c\u003c\u003c''',base64(parameters('keyvaultPrefix')),''')\n','MDMFRONTENDURL=$(base64 -d \u003c\u003c\u003c''',base64(parameters('mdmFrontendUrl')),''')\n','MDSDENVIRONMENT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('mdsdEnvironment')),''')\n','PORTALACCESSGROUPIDS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalAccessGroupIds')),''')\n','PORTALCLIENTID=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalClientId')),''')\n','PORTALELEVATEDGROUPIDS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('portalElevatedGroupIds')),''')\n','RPFEATURES=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpFeatures')),''')\n','RPIMAGE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpImage')),''')\n','RPMDMACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdmAccount')),''')\n','RPMDSDACCOUNT=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdAccount')),''')\n','RPMDSDCONFIGVERSION=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdConfigVersion')),''')\n','RPMDSDNAMESPACE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpMdsdNamespace')),''')\n','RPPARENTDOMAINNAME=$(base64 -d \u003c\u003c\u003c''',base64(parameters('rpParentDomainName')),''')\n','CLUSTERSINSTALLVIAHIVE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clustersInstallViaHive')),''')\n','CLUSTERSADOPTBYHIVE=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clustersAdoptByHive')),''')\n','CLUSTERDEFAULTINSTALLERPULLSPEC=$(base64 -d \u003c\u003c\u003c''',base64(parameters('clusterDefaultInstallerPullspec')),''')\n','USECHECKACCESS=$(base64 -d \u003c\u003c\u003c''',base64(parameters('useCheckAccess')),''')\n','ADMINAPICABUNDLE=''',parameters('adminApiCaBundle'),'''\n','ARMAPICABUNDLE=''',parameters('armApiCaBundle'),'''\n','MDMIMAGE=''/genevamdm:2.2023.928.2134-0de476-20230928t2244''\n','LOCATION=$(base64 -d \u003c\u003c\u003c''',base64(resourceGroup().location),''')\n','SUBSCRIPTIONID=$(base64 -d \u003c\u003c\u003c''',base64(subscription().subscriptionId),''')\n','RESOURCEGROUPNAME=$(base64 -d \u003c\u003c\u003c''',base64(resourceGroup().name),''')\n','\n',base64ToString('IyEvYmluL2Jhc2gKCmVjaG8gInNldHRpbmcgc3NoIHBhc3N3b3JkIGF1dGhlbnRpY2F0aW9uIgojIFdlIG5lZWQgdG8gbWFudWFsbHkgc2V0IFBhc3N3b3JkQXV0aGVudGljYXRpb24gdG8gdHJ1ZSBpbiBvcmRlciBmb3IgdGhlIFZNU1MgQWNjZXNzIEpJVCB0byB3b3JrCnNlZCAtaSAncy9QYXNzd29yZEF1dGhlbnRpY2F0aW9uIG5vL1Bhc3N3b3JkQXV0aGVudGljYXRpb24geWVzL2cnIC9ldGMvc3NoL3NzaGRfY29uZmlnCnN5c3RlbWN0bCByZWxvYWQgc3NoZC5zZXJ2aWNlCgplY2hvICJydW5uaW5nIFJIVUkgZml4Igp5dW0gdXBkYXRlIC15IC0tZGlzYWJsZXJlcG89JyonIC0tZW5hYmxlcmVwbz0ncmh1aS1taWNyb3NvZnQtYXp1cmUqJwoKZWNobyAicnVubmluZyB5dW0gdXBkYXRlIgp5dW0gLXkgLXggV0FMaW51eEFnZW50IC14IFdBTGludXhBZ2VudC11ZGV2IHVwZGF0ZSAtLWFsbG93ZXJhc2luZwoKZWNobyAiZXh0ZW5kaW5nIHBhcnRpdGlvbiB0YWJsZSIKIyBMaW51eCBibG9jayBkZXZpY2VzIGFyZSBpbmNvbnNpc3RlbnRseSBuYW1lZAojIGl0J3MgZGlmZmljdWx0IHRvIHRpZSB0aGUgbHZtIHB2IHRvIHRoZSBwaHlzaWNhbCBkaXNrIHVzaW5nIC9kZXYvZGlzayBmaWxlcywgd2hpY2ggaXMgd2h5IGx2cyBpcyB1c2VkIGhlcmUKcGh5c2ljYWxEaXNrPSIkKGx2cyAtbyBkZXZpY2VzIC1hIHwgaGVhZCAtbjIgfCB0YWlsIC1uMSB8IGN1dCAtZCAnICcgLWYgMyB8IGN1dCAtZCBcKCAtZiAxIHwgdHIgLWQgJ1s6ZGlnaXQ6XScpIgpncm93cGFydCAiJHBoeXNpY2FsRGlzayIgMgoKZWNobyAiZXh0ZW5kaW5nIGZpbGVzeXN0ZW1zIgpsdmV4dGVuZCAtbCArMjAlRlJFRSAvZGV2L3Jvb3R2Zy9yb290bHYKeGZzX2dyb3dmcyAvCgpsdmV4dGVuZCAtbCArMTAwJUZSRUUgL2Rldi9yb290dmcvdmFybHYKeGZzX2dyb3dmcyAvdmFyCgplY2hvICJpbXBvcnRpbmcgcnBtIHJlcG9zaXRvcmllcyIKcnBtIC0taW1wb3J0IGh0dHBzOi8vZGwuZmVkb3JhcHJvamVjdC5vcmcvcHViL2VwZWwvUlBNLUdQRy1LRVktRVBFTC04CnJwbSAtLWltcG9ydCBodHRwczovL3BhY2thZ2VzLm1pY3Jvc29mdC5jb20va2V5cy9taWNyb3NvZnQuYXNjCgpmb3IgYXR0ZW1wdCBpbiB7MS4uNX07IGRvCiAgeXVtIC15IGluc3RhbGwgaHR0cHM6Ly9kbC5mZWRvcmFwcm9qZWN0Lm9yZy9wdWIvZXBlbC9lcGVsLXJlbGVhc2UtbGF0ZXN0LTgubm9hcmNoLnJwbSAmJiBicmVhawogIGlmIFtbICR7YXR0ZW1wdH0gLWx0IDUgXV07IHRoZW4gc2xlZXAgMTA7IGVsc2UgZXhpdCAxOyBmaQpkb25lCgplY2hvICJjb25maWd1cmluZyBsb2dyb3RhdGUiCmNhdCA+L2V0Yy9sb2dyb3RhdGUuY29uZiA8PCdFT0YnCiMgc2VlICJtYW4gbG9ncm90YXRlIiBmb3IgZGV0YWlscwojIHJvdGF0ZSBsb2cgZmlsZXMgd2Vla2x5CndlZWtseQoKIyBrZWVwIDIgd2Vla3Mgd29ydGggb2YgYmFja2xvZ3MKcm90YXRlIDIKCiMgY3JlYXRlIG5ldyAoZW1wdHkpIGxvZyBmaWxlcyBhZnRlciByb3RhdGluZyBvbGQgb25lcwpjcmVhdGUKCiMgdXNlIGRhdGUgYXMgYSBzdWZmaXggb2YgdGhlIHJvdGF0ZWQgZmlsZQpkYXRlZXh0CgojIHVuY29tbWVudCB0aGlzIGlmIHlvdSB3YW50IHlvdXIgbG9nIGZpbGVzIGNvbXByZXNzZWQKY29tcHJlc3MKCiMgUlBNIHBhY2thZ2VzIGRyb3AgbG9nIHJvdGF0aW9uIGluZm9ybWF0aW9uIGludG8gdGhpcyBkaXJlY3RvcnkKaW5jbHVkZSAvZXRjL2xvZ3JvdGF0ZS5kCgojIG5vIHBhY2thZ2VzIG93biB3dG1wIGFuZCBidG1wIC0tIHdlJ2xsIHJvdGF0ZSB0aGVtIGhlcmUKL3Zhci9sb2cvd3RtcCB7CiAgICBtb250aGx5CiAgICBjcmVhdGUgMDY2NCByb290IHV0bXAKICAgICAgICBtaW5zaXplIDFNCiAgICByb3RhdGUgMQp9CgovdmFyL2xvZy9idG1wIHsKICAgIG1pc3NpbmdvawogICAgbW9udGhseQogICAgY3JlYXRlIDA2MDAgcm9vdCB1dG1wCiAgICByb3RhdGUgMQp9CkVPRgoKZWNobyAiY29uZmlndXJpbmcgeXVtIHJlcG9zaXRvcnkgYW5kIHJ1bm5pbmcgeXVtIHVwZGF0ZSIKY2F0ID4vZXRjL3l1bS5yZXBvcy5kL2F6dXJlLnJlcG8gPDwnRU9GJwpbYXp1cmUtY2xpXQpuYW1lPWF6dXJlLWNsaQpiYXNldXJsPWh0dHBzOi8vcGFja2FnZXMubWljcm9zb2Z0LmNvbS95dW1yZXBvcy9henVyZS1jbGkKZW5hYmxlZD15ZXMKZ3BnY2hlY2s9eWVzCgpbYXp1cmVjb3JlXQpuYW1lPWF6dXJlY29yZQpiYXNldXJsPWh0dHBzOi8vcGFja2FnZXMubWljcm9zb2Z0LmNvbS95dW1yZXBvcy9henVyZWNvcmUKZW5hYmxlZD15ZXMKZ3BnY2hlY2s9bm8KRU9GCgpzZW1hbmFnZSBmY29udGV4dCAtYSAtdCB2YXJfbG9nX3QgIi92YXIvbG9nL2pvdXJuYWwoLy4qKT8iCm1rZGlyIC1wIC92YXIvbG9nL2pvdXJuYWwKCmZvciBhdHRlbXB0IGluIHsxLi41fTsgZG8KeXVtIC15IGluc3RhbGwgY2xhbWF2IGF6c2VjLWNsYW1hdiBhenNlYy1tb25pdG9yIGF6dXJlLWNsaSBhenVyZS1tZHNkIGF6dXJlLXNlY3VyaXR5IHBvZG1hbiBwb2RtYW4tZG9ja2VyIG9wZW5zc2wtcGVybCBweXRob24zICYmIGJyZWFrCiAgIyBoYWNrIC0gd2UgYXJlIGluc3RhbGxpbmcgcHl0aG9uMyBvbiBob3N0cyBkdWUgdG8gYW4gaXNzdWUgd2l0aCBBenVyZSBMaW51eCBFeHRlbnNpb25zIGh0dHBzOi8vZ2l0aHViLmNvbS9BenVyZS9henVyZS1saW51eC1leHRlbnNpb25zL3B1bGwvMTUwNQogIGlmIFtbICR7YXR0ZW1wdH0gLWx0IDUgXV07IHRoZW4gc2xlZXAgMTA7IGVsc2UgZXhpdCAxOyBmaQpkb25lCgojIGh0dHBzOi8vYWNjZXNzLnJlZGhhdC5jb20vc2VjdXJpdHkvY3ZlL2N2ZS0yMDIwLTEzNDAxCmVjaG8gImFwcGx5aW5nIGZpcmV3YWxsIHJ1bGVzIgpjYXQgPi9ldGMvc3lzY3RsLmQvMDItZGlzYWJsZS1hY2NlcHQtcmEuY29uZiA8PCdFT0YnCm5ldC5pcHY2LmNvbmYuYWxsLmFjY2VwdF9yYT0wCkVPRgoKY2F0ID4vZXRjL3N5c2N0bC5kLzAxLWRpc2FibGUtY29yZS5jb25mIDw8J0VPRicKa2VybmVsLmNvcmVfcGF0dGVybiA9IHwvYmluL3RydWUKRU9GCnN5c2N0bCAtLXN5c3RlbQoKZmlyZXdhbGwtY21kIC0tYWRkLXBvcnQ9NDQzL3RjcCAtLXBlcm1hbmVudApmaXJld2FsbC1jbWQgLS1hZGQtcG9ydD00NDQvdGNwIC0tcGVybWFuZW50CmZpcmV3YWxsLWNtZCAtLWFkZC1wb3J0PTQ0NS90Y3AgLS1wZXJtYW5lbnQKZmlyZXdhbGwtY21kIC0tYWRkLXBvcnQ9MjIyMi90Y3AgLS1wZXJtYW5lbnQKCmV4cG9ydCBBWlVSRV9DTE9VRF9OQU1FPSRBWlVSRUNMT1VETkFNRQoKZWNobyAibG9nZ2luZyBpbnRvIHByb2QgYWNyIgpheiBsb2dpbiAtaSAtLWFsbG93LW5vLXN1YnNjcmlwdGlvbnMKCiMgU3VwcHJlc3MgZW11bGF0aW9uIG91dHB1dCBmb3IgcG9kbWFuIGluc3RlYWQgb2YgZG9ja2VyIGZvciBheiBhY3IgY29tcGF0YWJpbGl0eQpta2RpciAtcCAvZXRjL2NvbnRhaW5lcnMvCnRvdWNoIC9ldGMvY29udGFpbmVycy9ub2RvY2tlcgoKbWtkaXIgLXAgL3Jvb3QvLmRvY2tlcgpSRUdJU1RSWV9BVVRIX0ZJTEU9L3Jvb3QvLmRvY2tlci9jb25maWcuanNvbiBheiBhY3IgbG9naW4gLS1uYW1lICIkKHNlZCAtZSAnc3wuKi98fCcgPDw8IiRBQ1JSRVNPVVJDRUlEIikiCgpNRE1JTUFHRT0iJHtSUElNQUdFJSUvKn0vJHtNRE1JTUFHRSMjKi99Igpkb2NrZXIgcHVsbCAiJE1ETUlNQUdFIgpkb2NrZXIgcHVsbCAiJFJQSU1BR0UiCmRvY2tlciBwdWxsICIkRkxVRU5UQklUSU1BR0UiCgpheiBsb2dvdXQKCmVjaG8gImNvbmZpZ3VyaW5nIGZsdWVudGJpdCBzZXJ2aWNlIgpta2RpciAtcCAvZXRjL2ZsdWVudGJpdC8KbWtkaXIgLXAgL3Zhci9saWIvZmx1ZW50CgpjYXQgPi9ldGMvZmx1ZW50Yml0L2ZsdWVudGJpdC5jb25mIDw8J0VPRicKW0lOUFVUXQoJTmFtZSBzeXN0ZW1kCglUYWcgam91cm5hbGQKCVN5c3RlbWRfRmlsdGVyIF9DT01NPWFybwoJREIgL3Zhci9saWIvZmx1ZW50L2pvdXJuYWxkYgoKW0ZJTFRFUl0KCU5hbWUgbW9kaWZ5CglNYXRjaCBqb3VybmFsZAoJUmVtb3ZlX3dpbGRjYXJkIF8KCVJlbW92ZSBUSU1FU1RBTVAKCltGSUxURVJdCglOYW1lIHJld3JpdGVfdGFnCglNYXRjaCBqb3VybmFsZAoJUnVsZSAkTE9HS0lORCBhc3luY3FvcyBhc3luY3FvcyB0cnVlCgpbRklMVEVSXQoJTmFtZSBtb2RpZnkKCU1hdGNoIGFzeW5jcW9zCglSZW1vdmUgQ0xJRU5UX1BSSU5DSVBBTF9OQU1FCglSZW1vdmUgRklMRQoJUmVtb3ZlIENPTVBPTkVOVAoKW0ZJTFRFUl0KCU5hbWUgcmV3cml0ZV90YWcKCU1hdGNoIGpvdXJuYWxkCglSdWxlICRMT0dLSU5EIGlmeGF1ZGl0IGlmeGF1ZGl0IGZhbHNlCgpbT1VUUFVUXQoJTmFtZSBmb3J3YXJkCglNYXRjaCAqCglQb3J0IDI5MjMwCkVPRgoKZWNobyAiRkxVRU5UQklUSU1BR0U9JEZMVUVOVEJJVElNQUdFIiA+L2V0Yy9zeXNjb25maWcvZmx1ZW50Yml0CgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vZmx1ZW50Yml0LnNlcnZpY2UgPDwnRU9GJwpbVW5pdF0KQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldApTdGFydExpbWl0SW50ZXJ2YWxTZWM9MAoKW1NlcnZpY2VdClJlc3RhcnRTZWM9MXMKRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2ZsdWVudGJpdApFeGVjU3RhcnRQcmU9LS91c3IvYmluL2RvY2tlciBybSAtZiAlTgpFeGVjU3RhcnQ9L3Vzci9iaW4vZG9ja2VyIHJ1biBcCiAgLS1zZWN1cml0eS1vcHQgbGFiZWw9ZGlzYWJsZSBcCiAgLS1lbnRyeXBvaW50IC9vcHQvdGQtYWdlbnQtYml0L2Jpbi90ZC1hZ2VudC1iaXQgXAogIC0tbmV0PWhvc3QgXAogIC0taG9zdG5hbWUgJUggXAogIC0tbmFtZSAlTiBcCiAgLS1ybSBcCiAgLS1jYXAtZHJvcCBuZXRfcmF3IFwKICAtdiAvZXRjL2ZsdWVudGJpdC9mbHVlbnRiaXQuY29uZjovZXRjL2ZsdWVudGJpdC9mbHVlbnRiaXQuY29uZiBcCiAgLXYgL3Zhci9saWIvZmx1ZW50Oi92YXIvbGliL2ZsdWVudDp6IFwKICAtdiAvdmFyL2xvZy9qb3VybmFsOi92YXIvbG9nL2pvdXJuYWw6cm8gXAogIC12IC9ldGMvbWFjaGluZS1pZDovZXRjL21hY2hpbmUtaWQ6cm8gXAogICRGTFVFTlRCSVRJTUFHRSBcCiAgLWMgL2V0Yy9mbHVlbnRiaXQvZmx1ZW50Yml0LmNvbmYKCkV4ZWNTdG9wPS91c3IvYmluL2RvY2tlciBzdG9wICVOClJlc3RhcnQ9YWx3YXlzClJlc3RhcnRTZWM9NQpTdGFydExpbWl0SW50ZXJ2YWw9MAoKW0luc3RhbGxdCldhbnRlZEJ5PW11bHRpLXVzZXIudGFyZ2V0CkVPRgoKbWtkaXIgL2V0Yy9hcm8tcnAKYmFzZTY0IC1kIDw8PCIkQURNSU5BUElDQUJVTkRMRSIgPi9ldGMvYXJvLXJwL2FkbWluLWNhLWJ1bmRsZS5wZW0KaWYgW1sgLW4gIiRBUk1BUElDQUJVTkRMRSIgXV07IHRoZW4KICBiYXNlNjQgLWQgPDw8IiRBUk1BUElDQUJVTkRMRSIgPi9ldGMvYXJvLXJwL2FybS1jYS1idW5kbGUucGVtCmZpCmNob3duIC1SIDEwMDA6MTAwMCAvZXRjL2Fyby1ycAoKZWNobyAiY29uZmlndXJpbmcgbWRtIHNlcnZpY2UiCmNhdCA+L2V0Yy9zeXNjb25maWcvbWRtIDw8RU9GCk1ETUZST05URU5EVVJMPSckTURNRlJPTlRFTkRVUkwnCk1ETUlNQUdFPSckTURNSU1BR0UnCk1ETVNPVVJDRUVOVklST05NRU5UPSckTE9DQVRJT04nCk1ETVNPVVJDRVJPTEU9cnAKTURNU09VUkNFUk9MRUlOU1RBTkNFPSckKGhvc3RuYW1lKScKRU9GCgpta2RpciAvdmFyL2V0dwpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vbWRtLnNlcnZpY2UgPDwnRU9GJwpbVW5pdF0KQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldAoKW1NlcnZpY2VdCkVudmlyb25tZW50RmlsZT0vZXRjL3N5c2NvbmZpZy9tZG0KRXhlY1N0YXJ0UHJlPS0vdXNyL2Jpbi9kb2NrZXIgcm0gLWYgJU4KRXhlY1N0YXJ0PS91c3IvYmluL2RvY2tlciBydW4gXAogIC0tZW50cnlwb2ludCAvdXNyL3NiaW4vTWV0cmljc0V4dGVuc2lvbiBcCiAgLS1ob3N0bmFtZSAlSCBcCiAgLS1uYW1lICVOIFwKICAtLXJtIFwKICAtLWNhcC1kcm9wIG5ldF9yYXcgXAogIC1tIDJnIFwKICAtdiAvZXRjL21kbS5wZW06L2V0Yy9tZG0ucGVtIFwKICAtdiAvdmFyL2V0dzovdmFyL2V0dzp6IFwKICAkTURNSU1BR0UgXAogIC1DZXJ0RmlsZSAvZXRjL21kbS5wZW0gXAogIC1Gcm9udEVuZFVybCAkTURNRlJPTlRFTkRVUkwgXAogIC1Mb2dnZXIgQ29uc29sZSBcCiAgLUxvZ0xldmVsIFdhcm5pbmcgXAogIC1Qcml2YXRlS2V5RmlsZSAvZXRjL21kbS5wZW0gXAogIC1Tb3VyY2VFbnZpcm9ubWVudCAkTURNU09VUkNFRU5WSVJPTk1FTlQgXAogIC1Tb3VyY2VSb2xlICRNRE1TT1VSQ0VST0xFIFwKICAtU291cmNlUm9sZUluc3RhbmNlICRNRE1TT1VSQ0VST0xFSU5TVEFOQ0UKRXhlY1N0b3A9L3Vzci9iaW4vZG9ja2VyIHN0b3AgJU4KUmVzdGFydD1hbHdheXMKUmVzdGFydFNlYz0xClN0YXJ0TGltaXRJbnRlcnZhbD0wCgpbSW5zdGFsbF0KV2FudGVkQnk9bXVsdGktdXNlci50YXJnZXQKRU9GCgplY2hvICJjb25maWd1cmluZyBhcm8tcnAgc2VydmljZSIKY2F0ID4vZXRjL3N5c2NvbmZpZy9hcm8tcnAgPDxFT0YKQUNSX1JFU09VUkNFX0lEPSckQUNSUkVTT1VSQ0VJRCcKQURNSU5fQVBJX0NMSUVOVF9DRVJUX0NPTU1PTl9OQU1FPSckQURNSU5BUElDTElFTlRDRVJUQ09NTU9OTkFNRScKQVJNX0FQSV9DTElFTlRfQ0VSVF9DT01NT05fTkFNRT0nJEFSTUFQSUNMSUVOVENFUlRDT01NT05OQU1FJwpBWlVSRV9BUk1fQ0xJRU5UX0lEPSckQVJNQ0xJRU5USUQnCkFaVVJFX0ZQX0NMSUVOVF9JRD0nJEZQQ0xJRU5USUQnCkFaVVJFX0ZQX1NFUlZJQ0VfUFJJTkNJUEFMX0lEPSckRlBTRVJWSUNFUFJJTkNJUEFMSUQnCkJJTExJTkdfRTJFX1NUT1JBR0VfQUNDT1VOVF9JRD0nJEJJTExJTkdFMkVTVE9SQUdFQUNDT1VOVElEJwpDTFVTVEVSX01ETV9BQ0NPVU5UPSckQ0xVU1RFUk1ETUFDQ09VTlQnCkNMVVNURVJfTURNX05BTUVTUEFDRT1SUApDTFVTVEVSX01EU0RfQUNDT1VOVD0nJENMVVNURVJNRFNEQUNDT1VOVCcKQ0xVU1RFUl9NRFNEX0NPTkZJR19WRVJTSU9OPSckQ0xVU1RFUk1EU0RDT05GSUdWRVJTSU9OJwpDTFVTVEVSX01EU0RfTkFNRVNQQUNFPSckQ0xVU1RFUk1EU0ROQU1FU1BBQ0UnCkRBVEFCQVNFX0FDQ09VTlRfTkFNRT0nJERBVEFCQVNFQUNDT1VOVE5BTUUnCkRPTUFJTl9OQU1FPSckTE9DQVRJT04uJENMVVNURVJQQVJFTlRET01BSU5OQU1FJwpHQVRFV0FZX0RPTUFJTlM9JyRHQVRFV0FZRE9NQUlOUycKR0FURVdBWV9SRVNPVVJDRUdST1VQPSckR0FURVdBWVJFU09VUkNFR1JPVVBOQU1FJwpLRVlWQVVMVF9QUkVGSVg9JyRLRVlWQVVMVFBSRUZJWCcKTURNX0FDQ09VTlQ9JyRSUE1ETUFDQ09VTlQnCk1ETV9OQU1FU1BBQ0U9UlAKTURTRF9FTlZJUk9OTUVOVD0nJE1EU0RFTlZJUk9OTUVOVCcKUlBfRkVBVFVSRVM9JyRSUEZFQVRVUkVTJwpSUElNQUdFPSckUlBJTUFHRScKQVJPX0lOU1RBTExfVklBX0hJVkU9JyRDTFVTVEVSU0lOU1RBTExWSUFISVZFJwpBUk9fSElWRV9ERUZBVUxUX0lOU1RBTExFUl9QVUxMU1BFQz0nJENMVVNURVJERUZBVUxUSU5TVEFMTEVSUFVMTFNQRUMnCkFST19BRE9QVF9CWV9ISVZFPSckQ0xVU1RFUlNBRE9QVEJZSElWRScKVVNFX0NIRUNLQUNDRVNTPSckVVNFQ0hFQ0tBQ0NFU1MnCkVPRgoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL2Fyby1ycC5zZXJ2aWNlIDw8J0VPRicKW1VuaXRdCkFmdGVyPW5ldHdvcmstb25saW5lLnRhcmdldApXYW50cz1uZXR3b3JrLW9ubGluZS50YXJnZXQKCltTZXJ2aWNlXQpFbnZpcm9ubWVudEZpbGU9L2V0Yy9zeXNjb25maWcvYXJvLXJwCkV4ZWNTdGFydFByZT0tL3Vzci9iaW4vZG9ja2VyIHJtIC1mICVOCkV4ZWNTdGFydD0vdXNyL2Jpbi9kb2NrZXIgcnVuIFwKICAtLWhvc3RuYW1lICVIIFwKICAtLW5hbWUgJU4gXAogIC0tcm0gXAogIC0tY2FwLWRyb3AgbmV0X3JhdyBcCiAgLWUgQUNSX1JFU09VUkNFX0lEIFwKICAtZSBBRE1JTl9BUElfQ0xJRU5UX0NFUlRfQ09NTU9OX05BTUUgXAogIC1lIEFSTV9BUElfQ0xJRU5UX0NFUlRfQ09NTU9OX05BTUUgXAogIC1lIEFaVVJFX0FSTV9DTElFTlRfSUQgXAogIC1lIEFaVVJFX0ZQX0NMSUVOVF9JRCBcCiAgLWUgQklMTElOR19FMkVfU1RPUkFHRV9BQ0NPVU5UX0lEIFwKICAtZSBDTFVTVEVSX01ETV9BQ0NPVU5UIFwKICAtZSBDTFVTVEVSX01ETV9OQU1FU1BBQ0UgXAogIC1lIENMVVNURVJfTURTRF9BQ0NPVU5UIFwKICAtZSBDTFVTVEVSX01EU0RfQ09ORklHX1ZFUlNJT04gXAogIC1lIENMVVNURVJfTURTRF9OQU1FU1BBQ0UgXAogIC1lIERBVEFCQVNFX0FDQ09VTlRfTkFNRSBcCiAgLWUgRE9NQUlOX05BTUUgXAogIC1lIEdBVEVXQVlfRE9NQUlOUyBcCiAgLWUgR0FURVdBWV9SRVNPVVJDRUdST1VQIFwKICAtZSBLRVlWQVVMVF9QUkVGSVggXAogIC1lIE1ETV9BQ0NPVU5UIFwKICAtZSBNRE1fTkFNRVNQQUNFIFwKICAtZSBNRFNEX0VOVklST05NRU5UIFwKICAtZSBSUF9GRUFUVVJFUyBcCiAgLWUgQVJPX0lOU1RBTExfVklBX0hJVkUgXAogIC1lIEFST19ISVZFX0RFRkFVTFRfSU5TVEFMTEVSX1BVTExTUEVDIFwKICAtZSBBUk9fQURPUFRfQllfSElWRSBcCiAgLWUgVVNFX0NIRUNLQUNDRVNTIFwKICAtbSAyZyBcCiAgLXAgNDQzOjg0NDMgXAogIC12IC9ldGMvYXJvLXJwOi9ldGMvYXJvLXJwIFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIHJwCkV4ZWNTdG9wPS91c3IvYmluL2RvY2tlciBzdG9wIC10IDM2MDAgJU4KVGltZW91dFN0b3BTZWM9MzYwMApSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKU3RhcnRMaW1pdEludGVydmFsPTAKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIGFyby1kYnRva2VuIHNlcnZpY2UiCmNhdCA+L2V0Yy9zeXNjb25maWcvYXJvLWRidG9rZW4gPDxFT0YKREFUQUJBU0VfQUNDT1VOVF9OQU1FPSckREFUQUJBU0VBQ0NPVU5UTkFNRScKQVpVUkVfREJUT0tFTl9DTElFTlRfSUQ9JyREQlRPS0VOQ0xJRU5USUQnCkFaVVJFX0dBVEVXQVlfU0VSVklDRV9QUklOQ0lQQUxfSUQ9JyRHQVRFV0FZU0VSVklDRVBSSU5DSVBBTElEJwpLRVlWQVVMVF9QUkVGSVg9JyRLRVlWQVVMVFBSRUZJWCcKTURNX0FDQ09VTlQ9JyRSUE1ETUFDQ09VTlQnCk1ETV9OQU1FU1BBQ0U9REJUb2tlbgpSUElNQUdFPSckUlBJTUFHRScKRU9GCgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vYXJvLWRidG9rZW4uc2VydmljZSA8PCdFT0YnCltVbml0XQpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKV2FudHM9bmV0d29yay1vbmxpbmUudGFyZ2V0CgpbU2VydmljZV0KRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2Fyby1kYnRva2VuCkV4ZWNTdGFydFByZT0tL3Vzci9iaW4vZG9ja2VyIHJtIC1mICVOCkV4ZWNTdGFydD0vdXNyL2Jpbi9kb2NrZXIgcnVuIFwKICAtLWhvc3RuYW1lICVIIFwKICAtLW5hbWUgJU4gXAogIC0tcm0gXAogIC0tY2FwLWRyb3AgbmV0X3JhdyBcCiAgLWUgQVpVUkVfR0FURVdBWV9TRVJWSUNFX1BSSU5DSVBBTF9JRCBcCiAgLWUgREFUQUJBU0VfQUNDT1VOVF9OQU1FIFwKICAtZSBBWlVSRV9EQlRPS0VOX0NMSUVOVF9JRCBcCiAgLWUgS0VZVkFVTFRfUFJFRklYIFwKICAtZSBNRE1fQUNDT1VOVCBcCiAgLWUgTURNX05BTUVTUEFDRSBcCiAgLW0gMmcgXAogIC1wIDQ0NTo4NDQ1IFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIGRidG9rZW4KRXhlY1N0b3A9L3Vzci9iaW4vZG9ja2VyIHN0b3AgLXQgMzYwMCAlTgpUaW1lb3V0U3RvcFNlYz0zNjAwClJlc3RhcnQ9YWx3YXlzClJlc3RhcnRTZWM9MQpTdGFydExpbWl0SW50ZXJ2YWw9MAoKW0luc3RhbGxdCldhbnRlZEJ5PW11bHRpLXVzZXIudGFyZ2V0CkVPRgoKIyBET01BSU5fTkFNRSwgQ0xVU1RFUl9NRFNEX0FDQ09VTlQsIENMVVNURVJfTURTRF9DT05GSUdfVkVSU0lPTiwgR0FURVdBWV9ET01BSU5TLCBHQVRFV0FZX1JFU09VUkNFR1JPVVAsIE1EU0RfRU5WSVJPTk1FTlQgQ0xVU1RFUl9NRFNEX05BTUVTUEFDRQojIGFyZSBub3QgdXNlZCwgYnV0IGNhbid0IGVhc2lseSBiZSByZWZhY3RvcmVkIG91dC4gU2hvdWxkIGJlIHJldmlzaXRlZCBpbiB0aGUgZnV0dXJlLgplY2hvICJjb25maWd1cmluZyBhcm8tbW9uaXRvciBzZXJ2aWNlIgpjYXQgPi9ldGMvc3lzY29uZmlnL2Fyby1tb25pdG9yIDw8RU9GCkFaVVJFX0ZQX0NMSUVOVF9JRD0nJEZQQ0xJRU5USUQnCkRPTUFJTl9OQU1FPSckTE9DQVRJT04uJENMVVNURVJQQVJFTlRET01BSU5OQU1FJwpDTFVTVEVSX01EU0RfQUNDT1VOVD0nJENMVVNURVJNRFNEQUNDT1VOVCcKQ0xVU1RFUl9NRFNEX0NPTkZJR19WRVJTSU9OPSckQ0xVU1RFUk1EU0RDT05GSUdWRVJTSU9OJwpHQVRFV0FZX0RPTUFJTlM9JyRHQVRFV0FZRE9NQUlOUycKR0FURVdBWV9SRVNPVVJDRUdST1VQPSckR0FURVdBWVJFU09VUkNFR1JPVVBOQU1FJwpNRFNEX0VOVklST05NRU5UPSckTURTREVOVklST05NRU5UJwpDTFVTVEVSX01EU0RfTkFNRVNQQUNFPSckQ0xVU1RFUk1EU0ROQU1FU1BBQ0UnCkNMVVNURVJfTURNX0FDQ09VTlQ9JyRDTFVTVEVSTURNQUNDT1VOVCcKQ0xVU1RFUl9NRE1fTkFNRVNQQUNFPUJCTQpEQVRBQkFTRV9BQ0NPVU5UX05BTUU9JyREQVRBQkFTRUFDQ09VTlROQU1FJwpLRVlWQVVMVF9QUkVGSVg9JyRLRVlWQVVMVFBSRUZJWCcKTURNX0FDQ09VTlQ9JyRSUE1ETUFDQ09VTlQnCk1ETV9OQU1FU1BBQ0U9QkJNClJQSU1BR0U9JyRSUElNQUdFJwpFT0YKCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9hcm8tbW9uaXRvci5zZXJ2aWNlIDw8J0VPRicKW1VuaXRdCkFmdGVyPW5ldHdvcmstb25saW5lLnRhcmdldApXYW50cz1uZXR3b3JrLW9ubGluZS50YXJnZXQKCltTZXJ2aWNlXQpFbnZpcm9ubWVudEZpbGU9L2V0Yy9zeXNjb25maWcvYXJvLW1vbml0b3IKRXhlY1N0YXJ0UHJlPS0vdXNyL2Jpbi9kb2NrZXIgcm0gLWYgJU4KRXhlY1N0YXJ0PS91c3IvYmluL2RvY2tlciBydW4gXAogIC0taG9zdG5hbWUgJUggXAogIC0tbmFtZSAlTiBcCiAgLS1ybSBcCiAgLS1jYXAtZHJvcCBuZXRfcmF3IFwKICAtZSBBWlVSRV9GUF9DTElFTlRfSUQgXAogIC1lIERPTUFJTl9OQU1FIFwKICAtZSBDTFVTVEVSX01EU0RfQUNDT1VOVCBcCiAgLWUgQ0xVU1RFUl9NRFNEX0NPTkZJR19WRVJTSU9OIFwKICAtZSBHQVRFV0FZX0RPTUFJTlMgXAogIC1lIEdBVEVXQVlfUkVTT1VSQ0VHUk9VUCBcCiAgLWUgTURTRF9FTlZJUk9OTUVOVCBcCiAgLWUgQ0xVU1RFUl9NRFNEX05BTUVTUEFDRSBcCiAgLWUgQ0xVU1RFUl9NRE1fQUNDT1VOVCBcCiAgLWUgQ0xVU1RFUl9NRE1fTkFNRVNQQUNFIFwKICAtZSBEQVRBQkFTRV9BQ0NPVU5UX05BTUUgXAogIC1lIEtFWVZBVUxUX1BSRUZJWCBcCiAgLWUgTURNX0FDQ09VTlQgXAogIC1lIE1ETV9OQU1FU1BBQ0UgXAogIC1tIDIuNWcgXAogIC12IC9ydW4vc3lzdGVtZC9qb3VybmFsOi9ydW4vc3lzdGVtZC9qb3VybmFsIFwKICAtdiAvdmFyL2V0dzovdmFyL2V0dzp6IFwKICAkUlBJTUFHRSBcCiAgbW9uaXRvcgpSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKU3RhcnRMaW1pdEludGVydmFsPTAKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIGFyby1wb3J0YWwgc2VydmljZSIKY2F0ID4vZXRjL3N5c2NvbmZpZy9hcm8tcG9ydGFsIDw8RU9GCkFaVVJFX1BPUlRBTF9BQ0NFU1NfR1JPVVBfSURTPSckUE9SVEFMQUNDRVNTR1JPVVBJRFMnCkFaVVJFX1BPUlRBTF9DTElFTlRfSUQ9JyRQT1JUQUxDTElFTlRJRCcKQVpVUkVfUE9SVEFMX0VMRVZBVEVEX0dST1VQX0lEUz0nJFBPUlRBTEVMRVZBVEVER1JPVVBJRFMnCkRBVEFCQVNFX0FDQ09VTlRfTkFNRT0nJERBVEFCQVNFQUNDT1VOVE5BTUUnCktFWVZBVUxUX1BSRUZJWD0nJEtFWVZBVUxUUFJFRklYJwpNRE1fQUNDT1VOVD0nJFJQTURNQUNDT1VOVCcKTURNX05BTUVTUEFDRT1Qb3J0YWwKUE9SVEFMX0hPU1ROQU1FPSckTE9DQVRJT04uYWRtaW4uJFJQUEFSRU5URE9NQUlOTkFNRScKUlBJTUFHRT0nJFJQSU1BR0UnCkVPRgoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL2Fyby1wb3J0YWwuc2VydmljZSA8PCdFT0YnCltVbml0XQpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKV2FudHM9bmV0d29yay1vbmxpbmUudGFyZ2V0ClN0YXJ0TGltaXRJbnRlcnZhbD0wCgpbU2VydmljZV0KRW52aXJvbm1lbnRGaWxlPS9ldGMvc3lzY29uZmlnL2Fyby1wb3J0YWwKRXhlY1N0YXJ0UHJlPS0vdXNyL2Jpbi9kb2NrZXIgcm0gLWYgJU4KRXhlY1N0YXJ0PS91c3IvYmluL2RvY2tlciBydW4gXAogIC0taG9zdG5hbWUgJUggXAogIC0tbmFtZSAlTiBcCiAgLS1ybSBcCiAgLS1jYXAtZHJvcCBuZXRfcmF3IFwKICAtZSBBWlVSRV9QT1JUQUxfQUNDRVNTX0dST1VQX0lEUyBcCiAgLWUgQVpVUkVfUE9SVEFMX0NMSUVOVF9JRCBcCiAgLWUgQVpVUkVfUE9SVEFMX0VMRVZBVEVEX0dST1VQX0lEUyBcCiAgLWUgREFUQUJBU0VfQUNDT1VOVF9OQU1FIFwKICAtZSBLRVlWQVVMVF9QUkVGSVggXAogIC1lIE1ETV9BQ0NPVU5UIFwKICAtZSBNRE1fTkFNRVNQQUNFIFwKICAtZSBQT1JUQUxfSE9TVE5BTUUgXAogIC1tIDJnIFwKICAtcCA0NDQ6ODQ0NCBcCiAgLXAgMjIyMjoyMjIyIFwKICAtdiAvcnVuL3N5c3RlbWQvam91cm5hbDovcnVuL3N5c3RlbWQvam91cm5hbCBcCiAgLXYgL3Zhci9ldHc6L3Zhci9ldHc6eiBcCiAgJFJQSU1BR0UgXAogIHBvcnRhbApSZXN0YXJ0PWFsd2F5cwpSZXN0YXJ0U2VjPTEKCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCmVjaG8gImNvbmZpZ3VyaW5nIG1kc2QgYW5kIG1kbSBzZXJ2aWNlcyIKY2hjb24gLVIgc3lzdGVtX3U6b2JqZWN0X3I6dmFyX2xvZ190OnMwIC92YXIvb3B0L21pY3Jvc29mdC9saW51eG1vbmFnZW50Cgpta2RpciAtcCAvdmFyL2xpYi93YWFnZW50L01pY3Jvc29mdC5BenVyZS5LZXlWYXVsdC5TdG9yZQoKZm9yIHZhciBpbiAibWRzZCIgIm1kbSI7IGRvCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9kb3dubG9hZC0kdmFyLWNyZWRlbnRpYWxzLnNlcnZpY2UgPDxFT0YKW1VuaXRdCkRlc2NyaXB0aW9uPVBlcmlvZGljICR2YXIgY3JlZGVudGlhbHMgcmVmcmVzaAoKW1NlcnZpY2VdClR5cGU9b25lc2hvdApFeGVjU3RhcnQ9L3Vzci9sb2NhbC9iaW4vZG93bmxvYWQtY3JlZGVudGlhbHMuc2ggJHZhcgpFT0YKCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9kb3dubG9hZC0kdmFyLWNyZWRlbnRpYWxzLnRpbWVyIDw8RU9GCltVbml0XQpEZXNjcmlwdGlvbj1QZXJpb2RpYyAkdmFyIGNyZWRlbnRpYWxzIHJlZnJlc2gKQWZ0ZXI9bmV0d29yay1vbmxpbmUudGFyZ2V0CldhbnRzPW5ldHdvcmstb25saW5lLnRhcmdldAoKW1RpbWVyXQpPbkJvb3RTZWM9MG1pbgpPbkNhbGVuZGFyPTAvMTI6MDA6MDAKQWNjdXJhY3lTZWM9NXMKCltJbnN0YWxsXQpXYW50ZWRCeT10aW1lcnMudGFyZ2V0CkVPRgpkb25lCgpjYXQgPi91c3IvbG9jYWwvYmluL2Rvd25sb2FkLWNyZWRlbnRpYWxzLnNoIDw8RU9GCiMhL2Jpbi9iYXNoCnNldCAtZXUKCkNPTVBPTkVOVD0iXCQxIgplY2hvICJEb3dubG9hZCBcJENPTVBPTkVOVCBjcmVkZW50aWFscyIKClRFTVBfRElSPVwkKG1rdGVtcCAtZCkKZXhwb3J0IEFaVVJFX0NPTkZJR19ESVI9XCQobWt0ZW1wIC1kKQoKZWNobyAiTG9nZ2luZyBpbnRvIEF6dXJlLi4uIgpSRVRSSUVTPTMKd2hpbGUgWyAiXCRSRVRSSUVTIiAtZ3QgMCBdOyBkbwogICAgaWYgYXogbG9naW4gLWkgLS1hbGxvdy1uby1zdWJzY3JpcHRpb25zCiAgICB0aGVuCiAgICAgICAgZWNobyAiYXogbG9naW4gc3VjY2Vzc2Z1bCIKICAgICAgICBicmVhawogICAgZWxzZQogICAgICAgIGVjaG8gImF6IGxvZ2luIGZhaWxlZC4gUmV0cnlpbmcuLi4iCiAgICAgICAgbGV0IFJFVFJJRVMtPTEKICAgICAgICBzbGVlcCA1CiAgICBmaQpkb25lCgp0cmFwICJjbGVhbnVwIiBFWElUCgpjbGVhbnVwKCkgewogIGF6IGxvZ291dAogIFtbICJcJFRFTVBfRElSIiA9fiAvdG1wLy4rIF1dICYmIHJtIC1yZiBcJFRFTVBfRElSCiAgW1sgIlwkQVpVUkVfQ09ORklHX0RJUiIgPX4gL3RtcC8uKyBdXSAmJiBybSAtcmYgXCRBWlVSRV9DT05GSUdfRElSCn0KCmlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZG0iIF07IHRoZW4KICBDVVJSRU5UX0NFUlRfRklMRT0iL2V0Yy9tZG0ucGVtIgplbGlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZHNkIiBdOyB0aGVuCiAgQ1VSUkVOVF9DRVJUX0ZJTEU9Ii92YXIvbGliL3dhYWdlbnQvTWljcm9zb2Z0LkF6dXJlLktleVZhdWx0LlN0b3JlL21kc2QucGVtIgplbHNlCiAgZWNobyBJbnZhbGlkIHVzYWdlICYmIGV4aXQgMQpmaQoKU0VDUkVUX05BTUU9InJwLVwke0NPTVBPTkVOVH0iCk5FV19DRVJUX0ZJTEU9IlwkVEVNUF9ESVIvXCRDT01QT05FTlQucGVtIgpmb3IgYXR0ZW1wdCBpbiB7MS4uNX07IGRvCiAgYXoga2V5dmF1bHQgc2VjcmV0IGRvd25sb2FkIC0tZmlsZSBcJE5FV19DRVJUX0ZJTEUgLS1pZCAiaHR0cHM6Ly8kS0VZVkFVTFRQUkVGSVgtc3ZjLiRLRVlWQVVMVEROU1NVRkZJWC9zZWNyZXRzL1wkU0VDUkVUX05BTUUiICYmIGJyZWFrCiAgaWYgW1sgXCRhdHRlbXB0IC1sdCA1IF1dOyB0aGVuIHNsZWVwIDEwOyBlbHNlIGV4aXQgMTsgZmkKZG9uZQoKaWYgWyAtZiBcJE5FV19DRVJUX0ZJTEUgXTsgdGhlbgogIGlmIFsgIlwkQ09NUE9ORU5UIiA9ICJtZHNkIiBdOyB0aGVuCiAgICBjaG93biBzeXNsb2c6c3lzbG9nIFwkTkVXX0NFUlRfRklMRQogIGVsc2UKICAgIHNlZCAtaSAtbmUgJzEsL0VORCBDRVJUSUZJQ0FURS8gcCcgXCRORVdfQ0VSVF9GSUxFCiAgZmkKICBpZiAhIGRpZmYgJE5FV19DRVJUX0ZJTEUgJENVUlJFTlRfQ0VSVF9GSUxFID4vZGV2L251bGwgMj4mMTsgdGhlbgogICAgY2htb2QgMDYwMCBcJE5FV19DRVJUX0ZJTEUKICAgIG12IFwkTkVXX0NFUlRfRklMRSBcJENVUlJFTlRfQ0VSVF9GSUxFCiAgZmkKZWxzZQogIGVjaG8gRmFpbGVkIHRvIHJlZnJlc2ggY2VydGlmaWNhdGUgZm9yIFwkQ09NUE9ORU5UICYmIGV4aXQgMQpmaQpFT0YKCmNobW9kIHUreCAvdXNyL2xvY2FsL2Jpbi9kb3dubG9hZC1jcmVkZW50aWFscy5zaAoKc3lzdGVtY3RsIGVuYWJsZSBkb3dubG9hZC1tZHNkLWNyZWRlbnRpYWxzLnRpbWVyCnN5c3RlbWN0bCBlbmFibGUgZG93bmxvYWQtbWRtLWNyZWRlbnRpYWxzLnRpbWVyCgovdXNyL2xvY2FsL2Jpbi9kb3dubG9hZC1jcmVkZW50aWFscy5zaCBtZHNkCi91c3IvbG9jYWwvYmluL2Rvd25sb2FkLWNyZWRlbnRpYWxzLnNoIG1kbQpNRFNEQ0VSVElGSUNBVEVTQU49JChvcGVuc3NsIHg1MDkgLWluIC92YXIvbGliL3dhYWdlbnQvTWljcm9zb2Z0LkF6dXJlLktleVZhdWx0LlN0b3JlL21kc2QucGVtIC1ub291dCAtc3ViamVjdCB8IHNlZCAtZSAncy8uKkNOID0gLy8nKQoKY2F0ID4vZXRjL3N5c3RlbWQvc3lzdGVtL3dhdGNoLW1kbS1jcmVkZW50aWFscy5zZXJ2aWNlIDw8RU9GCltVbml0XQpEZXNjcmlwdGlvbj1XYXRjaCBmb3IgY2hhbmdlcyBpbiBtZG0ucGVtIGFuZCByZXN0YXJ0cyB0aGUgbWRtIHNlcnZpY2UKCltTZXJ2aWNlXQpUeXBlPW9uZXNob3QKRXhlY1N0YXJ0PS91c3IvYmluL3N5c3RlbWN0bCByZXN0YXJ0IG1kbS5zZXJ2aWNlCgpbSW5zdGFsbF0KV2FudGVkQnk9bXVsdGktdXNlci50YXJnZXQKRU9GCgpjYXQgPi9ldGMvc3lzdGVtZC9zeXN0ZW0vd2F0Y2gtbWRtLWNyZWRlbnRpYWxzLnBhdGggPDxFT0YKW1BhdGhdClBhdGhNb2RpZmllZD0vZXRjL21kbS5wZW0KCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldApFT0YKCnN5c3RlbWN0bCBlbmFibGUgd2F0Y2gtbWRtLWNyZWRlbnRpYWxzLnBhdGgKc3lzdGVtY3RsIHN0YXJ0IHdhdGNoLW1kbS1jcmVkZW50aWFscy5wYXRoCgpta2RpciAvZXRjL3N5c3RlbWQvc3lzdGVtL21kc2Quc2VydmljZS5kCmNhdCA+L2V0Yy9zeXN0ZW1kL3N5c3RlbS9tZHNkLnNlcnZpY2UuZC9vdmVycmlkZS5jb25mIDw8J0VPRicKW1VuaXRdCkFmdGVyPW5ldHdvcmstb25saW5lLnRhcmdldApFT0YKCmNhdCA+L2V0Yy9kZWZhdWx0L21kc2QgPDxFT0YKTURTRF9ST0xFX1BSRUZJWD0vdmFyL3J1bi9tZHNkL2RlZmF1bHQKTURTRF9PUFRJT05TPSItQSAtZCAtciBcJE1EU0RfUk9MRV9QUkVGSVgiCgpleHBvcnQgTU9OSVRPUklOR19HQ1NfRU5WSVJPTk1FTlQ9JyRNRFNERU5WSVJPTk1FTlQnCmV4cG9ydCBNT05JVE9SSU5HX0dDU19BQ0NPVU5UPSckUlBNRFNEQUNDT1VOVCcKZXhwb3J0IE1PTklUT1JJTkdfR0NTX1JFR0lPTj0nJExPQ0FUSU9OJwpleHBvcnQgTU9OSVRPUklOR19HQ1NfQVVUSF9JRF9UWVBFPUF1dGhLZXlWYXVsdApleHBvcnQgTU9OSVRPUklOR19HQ1NfQVVUSF9JRD0nJE1EU0RDRVJUSUZJQ0FURVNBTicKZXhwb3J0IE1PTklUT1JJTkdfR0NTX05BTUVTUEFDRT0nJFJQTURTRE5BTUVTUEFDRScKZXhwb3J0IE1PTklUT1JJTkdfQ09ORklHX1ZFUlNJT049JyRSUE1EU0RDT05GSUdWRVJTSU9OJwpleHBvcnQgTU9OSVRPUklOR19VU0VfR0VORVZBX0NPTkZJR19TRVJWSUNFPXRydWUKCmV4cG9ydCBNT05JVE9SSU5HX1RFTkFOVD0nJExPQ0FUSU9OJwpleHBvcnQgTU9OSVRPUklOR19ST0xFPXJwCmV4cG9ydCBNT05JVE9SSU5HX1JPTEVfSU5TVEFOQ0U9JyQoaG9zdG5hbWUpJwoKZXhwb3J0IE1EU0RfTVNHUEFDS19TT1JUX0NPTFVNTlM9MQpFT0YKCiMgc2V0dGluZyBNT05JVE9SSU5HX0dDU19BVVRIX0lEX1RZUEU9QXV0aEtleVZhdWx0IHNlZW1zIHRvIGhhdmUgY2F1c2VkIG1kc2Qgbm90CiMgdG8gaG9ub3VyIFNTTF9DRVJUX0ZJTEUgYW55IG1vcmUsIGhlYXZlbiBvbmx5IGtub3dzIHdoeS4KbWtkaXIgLXAgL3Vzci9saWIvc3NsL2NlcnRzCmNzcGxpdCAtZiAvdXNyL2xpYi9zc2wvY2VydHMvY2VydC0gLWIgJTAzZC5wZW0gL2V0Yy9wa2kvdGxzL2NlcnRzL2NhLWJ1bmRsZS5jcnQgL14kLzEgeyp9ID4vZGV2L251bGwKY19yZWhhc2ggL3Vzci9saWIvc3NsL2NlcnRzCgojIHdlIGxlYXZlIGNsaWVudElkIGJsYW5rIGFzIGxvbmcgYXMgb25seSAxIG1hbmFnZWQgaWRlbnRpdHkgYXNzaWduZWQgdG8gdm1zcwojIGlmIHdlIGhhdmUgbW9yZSB0aGFuIDEsIHdlIHdpbGwgbmVlZCB0byBwb3B1bGF0ZSB3aXRoIGNsaWVudElkIHVzZWQgZm9yIG9mZi1ub2RlIHNjYW5uaW5nCmNhdCA+L2V0Yy9kZWZhdWx0L3ZzYS1ub2Rlc2Nhbi1hZ2VudC5jb25maWcgPDxFT0YKewogICAgIk5pY2UiOiAxOSwKICAgICJUaW1lb3V0IjogMTA4MDAsCiAgICAiQ2xpZW50SWQiOiAiIiwKICAgICJUZW5hbnRJZCI6ICIkQVpVUkVTRUNQQUNLVlNBVEVOQU5USUQiLAogICAgIlF1YWx5c1N0b3JlQmFzZVVybCI6ICIkQVpVUkVTRUNQQUNLUVVBTFlTVVJMIiwKICAgICJQcm9jZXNzVGltZW91dCI6IDMwMCwKICAgICJDb21tYW5kRGVsYXkiOiAwCiAgfQpFT0YKCmVjaG8gImVuYWJsaW5nIGFybyBzZXJ2aWNlcyIKZm9yIHNlcnZpY2UgaW4gYXJvLWRidG9rZW4gYXJvLW1vbml0b3IgYXJvLXBvcnRhbCBhcm8tcnAgYXVvbXMgYXpzZWNkIGF6c2VjbW9uZCBtZHNkIG1kbSBjaHJvbnlkIGZsdWVudGJpdDsgZG8KICBzeXN0ZW1jdGwgZW5hYmxlICRzZXJ2aWNlLnNlcnZpY2UKZG9uZQoKZm9yIHNjYW4gaW4gYmFzZWxpbmUgY2xhbWF2IHNvZnR3YXJlOyBkbwogIC91c3IvbG9jYWwvYmluL2F6c2VjZCBjb25maWcgLXMgJHNjYW4gLWQgUDFECmRvbmUKCmVjaG8gInJlYm9vdGluZyIKcmVzdG9yZWNvbiAtUkYgL3Zhci9sb2cvKgooc2xlZXAgMzA7IHJlYm9vdCkgJgo=')))]" } } } diff --git a/pkg/deploy/generator/scripts/rpVMSS.sh b/pkg/deploy/generator/scripts/rpVMSS.sh index b3d554979be..e9b39aead5b 100644 --- a/pkg/deploy/generator/scripts/rpVMSS.sh +++ b/pkg/deploy/generator/scripts/rpVMSS.sh @@ -387,8 +387,18 @@ StartLimitInterval=0 WantedBy=multi-user.target EOF +# DOMAIN_NAME, CLUSTER_MDSD_ACCOUNT, CLUSTER_MDSD_CONFIG_VERSION, GATEWAY_DOMAINS, GATEWAY_RESOURCEGROUP, MDSD_ENVIRONMENT CLUSTER_MDSD_NAMESPACE +# are not used, but can't easily be refactored out. Should be revisited in the future. echo "configuring aro-monitor service" cat >/etc/sysconfig/aro-monitor < 0 { + return id.stringValue + } + + if id.Parent == nil { + return "" + } + + builder := strings.Builder{} + builder.WriteString(id.Parent.String()) + + if id.isChild { + builder.WriteString(fmt.Sprintf("/%s", id.ResourceType.lastType())) + if len(id.Name) > 0 { + builder.WriteString(fmt.Sprintf("/%s", id.Name)) + } + } else { + builder.WriteString(fmt.Sprintf("/providers/%s/%s/%s", id.ResourceType.Namespace, id.ResourceType.Type, id.Name)) + } + + id.stringValue = builder.String() + + return id.stringValue +} + +func newResourceID(parent *ResourceID, resourceTypeName string, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, chooseResourceType(resourceTypeName, parent), resourceName, true) + return id +} + +func newResourceIDWithResourceType(parent *ResourceID, resourceType ResourceType, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, resourceType, resourceName, true) + return id +} + +func newResourceIDWithProvider(parent *ResourceID, providerNamespace, resourceTypeName, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, NewResourceType(providerNamespace, resourceTypeName), resourceName, false) + return id +} + +func chooseResourceType(resourceTypeName string, parent *ResourceID) ResourceType { + if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) { + return ResourceGroupResourceType + } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && parent != nil && parent.ResourceType.String() == TenantResourceType.String() { + return SubscriptionResourceType + } + + return parent.ResourceType.AppendChild(resourceTypeName) +} + +func (id *ResourceID) init(parent *ResourceID, resourceType ResourceType, name string, isChild bool) { + if parent != nil { + id.Provider = parent.Provider + id.SubscriptionID = parent.SubscriptionID + id.ResourceGroupName = parent.ResourceGroupName + id.Location = parent.Location + } + + if resourceType.String() == SubscriptionResourceType.String() { + id.SubscriptionID = name + } + + if resourceType.lastType() == locationsKey { + id.Location = name + } + + if resourceType.String() == ResourceGroupResourceType.String() { + id.ResourceGroupName = name + } + + if resourceType.String() == ProviderResourceType.String() { + id.Provider = name + } + + if parent == nil { + id.Parent = RootResourceID + } else { + id.Parent = parent + } + id.isChild = isChild + id.ResourceType = resourceType + id.Name = name +} + +func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, error) { + if len(parts) == 0 { + return parent, nil + } + + 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) { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + // resourceGroup must contain either child or provider resource type + if parent.ResourceType.String() == ResourceGroupResourceType.String() { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + return newResourceID(parent, parts[0], ""), nil + } + + 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() { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + return appendNext(newResourceIDWithResourceType(parent, ProviderResourceType, parts[1]), parts[2:], id) + } + + if len(parts) > 3 && strings.EqualFold(parts[0], providersKey) { + return appendNext(newResourceIDWithProvider(parent, parts[1], parts[2], parts[3]), parts[4:], id) + } + + if len(parts) > 1 && !strings.EqualFold(parts[0], providersKey) { + return appendNext(newResourceID(parent, parts[0], parts[1]), parts[2:], id) + } + + return nil, fmt.Errorf("invalid resource ID: %s", id) +} + +func splitStringAndOmitEmpty(v, sep string) []string { + r := make([]string, 0) + for _, s := range strings.Split(v, sep) { + if len(s) == 0 { + continue + } + r = append(r, s) + } + + return r +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go new file mode 100644 index 00000000000..ca03ac9713d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go @@ -0,0 +1,114 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package resource + +import ( + "fmt" + "strings" +) + +// SubscriptionResourceType is the ResourceType of a subscription +var SubscriptionResourceType = NewResourceType(builtInResourceNamespace, "subscriptions") + +// ResourceGroupResourceType is the ResourceType of a resource group +var ResourceGroupResourceType = NewResourceType(builtInResourceNamespace, "resourceGroups") + +// TenantResourceType is the ResourceType of a tenant +var TenantResourceType = NewResourceType(builtInResourceNamespace, "tenants") + +// ProviderResourceType is the ResourceType of a provider +var ProviderResourceType = NewResourceType(builtInResourceNamespace, "providers") + +// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets". +// Don't create this type directly, use ParseResourceType or NewResourceType instead. +type ResourceType struct { + // Namespace is the namespace of the resource type. + // e.g. "Microsoft.Network" in resource type "Microsoft.Network/virtualNetworks/subnets" + Namespace string + + // Type is the full type name of the resource type. + // e.g. "virtualNetworks/subnets" in resource type "Microsoft.Network/virtualNetworks/subnets" + Type string + + // Types is the slice of all the sub-types of this resource type. + // e.g. ["virtualNetworks", "subnets"] in resource type "Microsoft.Network/virtualNetworks/subnets" + Types []string + + stringValue string +} + +// String returns the string of the ResourceType +func (t ResourceType) String() string { + return t.stringValue +} + +// IsParentOf returns true when the receiver is the parent resource type of the child. +func (t ResourceType) IsParentOf(child ResourceType) bool { + if !strings.EqualFold(t.Namespace, child.Namespace) { + return false + } + if len(t.Types) >= len(child.Types) { + return false + } + for i := range t.Types { + if !strings.EqualFold(t.Types[i], child.Types[i]) { + return false + } + } + + return true +} + +// AppendChild creates an instance of ResourceType using the receiver as the parent with childType appended to it. +func (t ResourceType) AppendChild(childType string) ResourceType { + return NewResourceType(t.Namespace, fmt.Sprintf("%s/%s", t.Type, childType)) +} + +// NewResourceType creates an instance of ResourceType using a provider namespace +// such as "Microsoft.Network" and type such as "virtualNetworks/subnets". +func NewResourceType(providerNamespace, typeName string) ResourceType { + return ResourceType{ + Namespace: providerNamespace, + Type: typeName, + Types: splitStringAndOmitEmpty(typeName, "/"), + stringValue: fmt.Sprintf("%s/%s", providerNamespace, typeName), + } +} + +// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets) +// or a resource identifier string. +// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet) +func ParseResourceType(resourceIDOrType string) (ResourceType, error) { + // split the path into segments + parts := splitStringAndOmitEmpty(resourceIDOrType, "/") + + // There must be at least a namespace and type name + if len(parts) < 1 { + return ResourceType{}, fmt.Errorf("invalid resource ID or type: %s", resourceIDOrType) + } + + // if the type is just subscriptions, it is a built-in type in the Microsoft.Resources namespace + if len(parts) == 1 { + // Simple resource type + return NewResourceType(builtInResourceNamespace, parts[0]), nil + } else if strings.Contains(parts[0], ".") { + // Handle resource types (Microsoft.Compute/virtualMachines, Microsoft.Network/virtualNetworks/subnets) + // it is a full type name + return NewResourceType(parts[0], strings.Join(parts[1:], "/")), nil + } else { + // Check if ResourceID + id, err := ParseResourceID(resourceIDOrType) + if err != nil { + return ResourceType{}, err + } + return NewResourceType(id.ResourceType.Namespace, id.ResourceType.Type), nil + } +} + +func (t ResourceType) lastType() string { + return t.Types[len(t.Types)-1] +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go new file mode 100644 index 00000000000..83cf91e3ecb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go @@ -0,0 +1,98 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package policy + +import ( + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" +) + +// BearerTokenOptions configures the bearer token policy's behavior. +type BearerTokenOptions struct { + // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests. + // The policy will add a token from each of these tenants to every request. The + // authenticating user or service principal must be a guest in these tenants, and the + // policy's credential must support multitenant authentication. + AuxiliaryTenants []string + + // Scopes contains the list of permission scopes required for the token. + Scopes []string +} + +// RegistrationOptions configures the registration policy's behavior. +// All zero-value fields will be initialized with their default values. +type RegistrationOptions struct { + policy.ClientOptions + + // MaxAttempts is the total number of times to attempt automatic registration + // in the event that an attempt fails. + // The default value is 3. + // Set to a value less than zero to disable the policy. + MaxAttempts int + + // PollingDelay is the amount of time to sleep between polling intervals. + // The default value is 15 seconds. + // A value less than zero means no delay between polling intervals (not recommended). + PollingDelay time.Duration + + // PollingDuration is the amount of time to wait before abandoning polling. + // The default valule is 5 minutes. + // NOTE: Setting this to a small value might cause the policy to prematurely fail. + PollingDuration time.Duration +} + +// ClientOptions contains configuration settings for a client's pipeline. +type ClientOptions struct { + policy.ClientOptions + + // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests. + // The client will add a token from each of these tenants to every request. The + // authenticating user or service principal must be a guest in these tenants, and the + // client's credential must support multitenant authentication. + AuxiliaryTenants []string + + // DisableRPRegistration disables the auto-RP registration policy. Defaults to false. + DisableRPRegistration bool +} + +// Clone return a deep copy of the current options. +func (o *ClientOptions) Clone() *ClientOptions { + if o == nil { + return nil + } + copiedOptions := *o + copiedOptions.Cloud.Services = copyMap(copiedOptions.Cloud.Services) + copiedOptions.Logging.AllowedHeaders = copyArray(copiedOptions.Logging.AllowedHeaders) + copiedOptions.Logging.AllowedQueryParams = copyArray(copiedOptions.Logging.AllowedQueryParams) + copiedOptions.Retry.StatusCodes = copyArray(copiedOptions.Retry.StatusCodes) + copiedOptions.PerRetryPolicies = copyArray(copiedOptions.PerRetryPolicies) + copiedOptions.PerCallPolicies = copyArray(copiedOptions.PerCallPolicies) + return &copiedOptions +} + +// copyMap return a new map with all the key value pair in the src map +func copyMap[K comparable, V any](src map[K]V) map[K]V { + if src == nil { + return nil + } + copiedMap := make(map[K]V) + for k, v := range src { + copiedMap[k] = v + } + return copiedMap +} + +// copyMap return a new array with all the elements in the src array +func copyArray[T any](src []T) []T { + if src == nil { + return nil + } + copiedArray := make([]T, len(src)) + copy(copiedArray, src) + return copiedArray +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go new file mode 100644 index 00000000000..d35d6374fdc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go @@ -0,0 +1,23 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package arm + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" +) + +// RootResourceID defines the tenant as the root parent of all other ResourceID. +var RootResourceID = resource.RootResourceID + +// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`. +// Don't create this type directly, use ParseResourceID instead. +type ResourceID = resource.ResourceID + +// ParseResourceID parses a string to an instance of ResourceID +func ParseResourceID(id string) (*ResourceID, error) { + return resource.ParseResourceID(id) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go new file mode 100644 index 00000000000..fc7fbffd260 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go @@ -0,0 +1,40 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package arm + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" +) + +// SubscriptionResourceType is the ResourceType of a subscription +var SubscriptionResourceType = resource.SubscriptionResourceType + +// ResourceGroupResourceType is the ResourceType of a resource group +var ResourceGroupResourceType = resource.ResourceGroupResourceType + +// TenantResourceType is the ResourceType of a tenant +var TenantResourceType = resource.TenantResourceType + +// ProviderResourceType is the ResourceType of a provider +var ProviderResourceType = resource.ProviderResourceType + +// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets". +// Don't create this type directly, use ParseResourceType or NewResourceType instead. +type ResourceType = resource.ResourceType + +// NewResourceType creates an instance of ResourceType using a provider namespace +// such as "Microsoft.Network" and type such as "virtualNetworks/subnets". +func NewResourceType(providerNamespace, typeName string) ResourceType { + return resource.NewResourceType(providerNamespace, typeName) +} + +// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets) +// or a resource identifier string. +// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet) +func ParseResourceType(resourceIDOrType string) (ResourceType, error) { + return resource.ParseResourceType(resourceIDOrType) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go new file mode 100644 index 00000000000..266c74b17bf --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go @@ -0,0 +1,64 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "errors" + "reflect" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// NewPipeline creates a pipeline from connection options. Policies from ClientOptions are +// placed after policies from PipelineOptions. The telemetry policy, when enabled, will +// use the specified module and version info. +func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azruntime.PipelineOptions, options *armpolicy.ClientOptions) (azruntime.Pipeline, error) { + if options == nil { + options = &armpolicy.ClientOptions{} + } + conf, err := getConfiguration(&options.ClientOptions) + if err != nil { + return azruntime.Pipeline{}, err + } + authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{ + AuxiliaryTenants: options.AuxiliaryTenants, + Scopes: []string{conf.Audience + "/.default"}, + }) + perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1) + copy(perRetry, plOpts.PerRetry) + plOpts.PerRetry = append(perRetry, authPolicy) + if !options.DisableRPRegistration { + regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions} + regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts) + if err != nil { + return azruntime.Pipeline{}, err + } + perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1) + copy(perCall, plOpts.PerCall) + plOpts.PerCall = append(perCall, regPolicy) + } + if plOpts.APIVersion.Name == "" { + plOpts.APIVersion.Name = "api-version" + } + return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil +} + +func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) { + c := cloud.AzurePublic + if !reflect.ValueOf(o.Cloud).IsZero() { + c = o.Cloud + } + if conf, ok := c.Services[cloud.ResourceManager]; ok && conf.Endpoint != "" && conf.Audience != "" { + return conf, nil + } else { + return conf, errors.New("provided Cloud field is missing Azure Resource Manager configuration") + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go new file mode 100644 index 00000000000..07f15991eb2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "context" + "fmt" + "net/http" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/internal/temporal" +) + +const headerAuxiliaryAuthorization = "x-ms-authorization-auxiliary" + +// acquiringResourceState holds data for an auxiliary token request +type acquiringResourceState struct { + ctx context.Context + p *BearerTokenPolicy + tenant string +} + +// acquire acquires or updates the resource; only one +// thread/goroutine at a time ever calls this function +func acquire(state acquiringResourceState) (newResource azcore.AccessToken, newExpiration time.Time, err error) { + tk, err := state.p.cred.GetToken(state.ctx, azpolicy.TokenRequestOptions{ + Scopes: state.p.scopes, + TenantID: state.tenant, + }) + if err != nil { + return azcore.AccessToken{}, time.Time{}, err + } + return tk, tk.ExpiresOn, nil +} + +// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential. +type BearerTokenPolicy struct { + auxResources map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState] + btp *azruntime.BearerTokenPolicy + cred azcore.TokenCredential + scopes []string +} + +// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens. +// cred: an azcore.TokenCredential implementation such as a credential object from azidentity +// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options. +func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTokenOptions) *BearerTokenPolicy { + if opts == nil { + opts = &armpolicy.BearerTokenOptions{} + } + p := &BearerTokenPolicy{cred: cred} + p.auxResources = make(map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState], len(opts.AuxiliaryTenants)) + for _, t := range opts.AuxiliaryTenants { + p.auxResources[t] = temporal.NewResource(acquire) + } + p.scopes = make([]string, len(opts.Scopes)) + copy(p.scopes, opts.Scopes) + p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{ + AuthorizationHandler: azpolicy.AuthorizationHandler{OnRequest: p.onRequest}, + }) + return p +} + +// onRequest authorizes requests with one or more bearer tokens +func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolicy.TokenRequestOptions) error) error { + // authorize the request with a token for the primary tenant + err := authNZ(azpolicy.TokenRequestOptions{Scopes: b.scopes}) + if err != nil || len(b.auxResources) == 0 { + return err + } + // add tokens for auxiliary tenants + as := acquiringResourceState{ + ctx: req.Raw().Context(), + p: b, + } + auxTokens := make([]string, 0, len(b.auxResources)) + for tenant, er := range b.auxResources { + as.tenant = tenant + auxTk, err := er.Get(as) + if err != nil { + return err + } + auxTokens = append(auxTokens, fmt.Sprintf("%s%s", shared.BearerTokenPrefix, auxTk.Token)) + } + req.Raw().Header.Set(headerAuxiliaryAuthorization, strings.Join(auxTokens, ", ")) + return nil +} + +// Do authorizes a request with a bearer token +func (b *BearerTokenPolicy) Do(req *azpolicy.Request) (*http.Response, error) { + return b.btp.Do(req) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go new file mode 100644 index 00000000000..c3f5eeafe02 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/internal/log" +) + +const ( + // LogRPRegistration entries contain information specific to the automatic registration of an RP. + // Entries of this classification are written IFF the policy needs to take any action. + LogRPRegistration log.Event = "RPRegistration" +) + +// init sets any default values +func setDefaults(r *armpolicy.RegistrationOptions) { + if r.MaxAttempts == 0 { + r.MaxAttempts = 3 + } else if r.MaxAttempts < 0 { + r.MaxAttempts = 0 + } + if r.PollingDelay == 0 { + r.PollingDelay = 15 * time.Second + } else if r.PollingDelay < 0 { + r.PollingDelay = 0 + } + if r.PollingDuration == 0 { + r.PollingDuration = 5 * time.Minute + } +} + +// NewRPRegistrationPolicy creates a policy object configured using the specified options. +// The policy controls whether an unregistered resource provider should automatically be +// registered. See https://aka.ms/rps-not-found for more information. +func NewRPRegistrationPolicy(cred azcore.TokenCredential, o *armpolicy.RegistrationOptions) (azpolicy.Policy, error) { + if o == nil { + o = &armpolicy.RegistrationOptions{} + } + conf, err := getConfiguration(&o.ClientOptions) + if err != nil { + return nil, err + } + authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{conf.Audience + "/.default"}}) + p := &rpRegistrationPolicy{ + endpoint: conf.Endpoint, + pipeline: runtime.NewPipeline(shared.Module, shared.Version, runtime.PipelineOptions{PerRetry: []azpolicy.Policy{authPolicy}}, &o.ClientOptions), + options: *o, + } + // init the copy + setDefaults(&p.options) + return p, nil +} + +type rpRegistrationPolicy struct { + endpoint string + pipeline runtime.Pipeline + options armpolicy.RegistrationOptions +} + +func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) { + if r.options.MaxAttempts == 0 { + // policy is disabled + return req.Next() + } + const registeredState = "Registered" + var rp string + var resp *http.Response + for attempts := 0; attempts < r.options.MaxAttempts; attempts++ { + var err error + // make the original request + resp, err = req.Next() + // getting a 409 is the first indication that the RP might need to be registered, check error response + if err != nil || resp.StatusCode != http.StatusConflict { + return resp, err + } + var reqErr requestError + if err = runtime.UnmarshalAsJSON(resp, &reqErr); err != nil { + return resp, err + } + if reqErr.ServiceError == nil { + // missing service error info. just return the response + // to the caller so its error unmarshalling will kick in + return resp, err + } + if !isUnregisteredRPCode(reqErr.ServiceError.Code) { + // not a 409 due to unregistered RP. just return the response + // to the caller so its error unmarshalling will kick in + return resp, err + } + // RP needs to be registered. start by getting the subscription ID from the original request + subID, err := getSubscription(req.Raw().URL.Path) + if err != nil { + return resp, err + } + // now get the RP from the error + rp, err = getProvider(reqErr) + if err != nil { + return resp, err + } + logRegistrationExit := func(v interface{}) { + log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v) + } + log.Writef(LogRPRegistration, "BEGIN registration for %s", rp) + // create client and make the registration request + // we use the scheme and host from the original request + rpOps := &providersOperations{ + p: r.pipeline, + u: r.endpoint, + subID: subID, + } + if _, err = rpOps.Register(req.Raw().Context(), rp); err != nil { + logRegistrationExit(err) + return resp, err + } + // RP was registered, however we need to wait for the registration to complete + pollCtx, pollCancel := context.WithTimeout(req.Raw().Context(), r.options.PollingDuration) + var lastRegState string + for { + // get the current registration state + getResp, err := rpOps.Get(pollCtx, rp) + if err != nil { + pollCancel() + logRegistrationExit(err) + return resp, err + } + if getResp.Provider.RegistrationState != nil && !strings.EqualFold(*getResp.Provider.RegistrationState, lastRegState) { + // registration state has changed, or was updated for the first time + lastRegState = *getResp.Provider.RegistrationState + log.Writef(LogRPRegistration, "registration state is %s", lastRegState) + } + if strings.EqualFold(lastRegState, registeredState) { + // registration complete + pollCancel() + logRegistrationExit(lastRegState) + break + } + // wait before trying again + select { + case <-time.After(r.options.PollingDelay): + // continue polling + case <-pollCtx.Done(): + pollCancel() + logRegistrationExit(pollCtx.Err()) + return resp, pollCtx.Err() + } + } + // RP was successfully registered, retry the original request + err = req.RewindBody() + if err != nil { + return resp, err + } + } + // if we get here it means we exceeded the number of attempts + return resp, fmt.Errorf("exceeded attempts to register %s", rp) +} + +var unregisteredRPCodes = []string{ + "MissingSubscriptionRegistration", + "MissingRegistrationForResourceProvider", + "Subscription Not Registered", +} + +func isUnregisteredRPCode(errorCode string) bool { + for _, code := range unregisteredRPCodes { + if strings.EqualFold(errorCode, code) { + return true + } + } + return false +} + +func getSubscription(path string) (string, error) { + parts := strings.Split(path, "/") + for i, v := range parts { + if v == "subscriptions" && (i+1) < len(parts) { + return parts[i+1], nil + } + } + return "", fmt.Errorf("failed to obtain subscription ID from %s", path) +} + +func getProvider(re requestError) (string, error) { + if len(re.ServiceError.Details) > 0 { + return re.ServiceError.Details[0].Target, nil + } + return "", errors.New("unexpected empty Details") +} + +// minimal error definitions to simplify detection +type requestError struct { + ServiceError *serviceError `json:"error"` +} + +type serviceError struct { + Code string `json:"code"` + Details []serviceErrorDetails `json:"details"` +} + +type serviceErrorDetails struct { + Code string `json:"code"` + Target string `json:"target"` +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// the following code was copied from module armresources, providers.go and models.go +// only the minimum amount of code was copied to get this working and some edits were made. +/////////////////////////////////////////////////////////////////////////////////////////////// + +type providersOperations struct { + p runtime.Pipeline + u string + subID string +} + +// Get - Gets the specified resource provider. +func (client *providersOperations) Get(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) { + req, err := client.getCreateRequest(ctx, resourceProviderNamespace) + if err != nil { + return providerResponse{}, err + } + resp, err := client.p.Do(req) + if err != nil { + return providerResponse{}, err + } + result, err := client.getHandleResponse(resp) + if err != nil { + return providerResponse{}, err + } + return result, nil +} + +// getCreateRequest creates the Get request. +func (client *providersOperations) getCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}" + urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.u, urlPath)) + if err != nil { + return nil, err + } + query := req.Raw().URL.Query() + query.Set("api-version", "2019-05-01") + req.Raw().URL.RawQuery = query.Encode() + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *providersOperations) getHandleResponse(resp *http.Response) (providerResponse, error) { + if !runtime.HasStatusCode(resp, http.StatusOK) { + return providerResponse{}, exported.NewResponseError(resp) + } + result := providerResponse{RawResponse: resp} + err := runtime.UnmarshalAsJSON(resp, &result.Provider) + if err != nil { + return providerResponse{}, err + } + return result, err +} + +// Register - Registers a subscription with a resource provider. +func (client *providersOperations) Register(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) { + req, err := client.registerCreateRequest(ctx, resourceProviderNamespace) + if err != nil { + return providerResponse{}, err + } + resp, err := client.p.Do(req) + if err != nil { + return providerResponse{}, err + } + result, err := client.registerHandleResponse(resp) + if err != nil { + return providerResponse{}, err + } + return result, nil +} + +// registerCreateRequest creates the Register request. +func (client *providersOperations) registerCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register" + urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.u, urlPath)) + if err != nil { + return nil, err + } + query := req.Raw().URL.Query() + query.Set("api-version", "2019-05-01") + req.Raw().URL.RawQuery = query.Encode() + return req, nil +} + +// registerHandleResponse handles the Register response. +func (client *providersOperations) registerHandleResponse(resp *http.Response) (providerResponse, error) { + if !runtime.HasStatusCode(resp, http.StatusOK) { + return providerResponse{}, exported.NewResponseError(resp) + } + result := providerResponse{RawResponse: resp} + err := runtime.UnmarshalAsJSON(resp, &result.Provider) + if err != nil { + return providerResponse{}, err + } + return result, err +} + +// ProviderResponse is the response envelope for operations that return a Provider type. +type providerResponse struct { + // Resource provider information. + Provider *provider + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// Provider - Resource provider information. +type provider struct { + // The provider ID. + ID *string `json:"id,omitempty"` + + // The namespace of the resource provider. + Namespace *string `json:"namespace,omitempty"` + + // The registration policy of the resource provider. + RegistrationPolicy *string `json:"registrationPolicy,omitempty"` + + // The registration state of the resource provider. + RegistrationState *string `json:"registrationState,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go new file mode 100644 index 00000000000..1400d43799f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go @@ -0,0 +1,24 @@ +//go:build go1.16 +// +build go1.16 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + +func init() { + cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.chinacloudapi.cn", + Endpoint: "https://management.chinacloudapi.cn", + } + cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.usgovcloudapi.net", + Endpoint: "https://management.usgovcloudapi.net", + } + cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.windows.net/", + Endpoint: "https://management.azure.com", + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/CHANGELOG.md new file mode 100644 index 00000000000..cf63a807bfd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/CHANGELOG.md @@ -0,0 +1,614 @@ +# Release History + +## 2.2.1 (2023-04-14) +### Bug Fixes + +- Fix serialization bug of empty value of `any` type. + + +## 2.2.0 (2023-03-24) +### Features Added + +- New struct `ClientFactory` which is a client factory used to create any client in this module +- New value `ApplicationGatewayCustomErrorStatusCodeHTTPStatus400`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus404`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus405`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus408`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus499`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus500`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus503`, `ApplicationGatewayCustomErrorStatusCodeHTTPStatus504` added to enum type `ApplicationGatewayCustomErrorStatusCode` +- New enum type `WebApplicationFirewallState` with values `WebApplicationFirewallStateDisabled`, `WebApplicationFirewallStateEnabled` +- New field `AuthorizationStatus` in struct `ExpressRouteCircuitPropertiesFormat` +- New field `IPConfigurationID` in struct `VPNGatewaysClientBeginResetOptions` +- New field `FlowLogs` in struct `VirtualNetworkPropertiesFormat` +- New field `State` in struct `WebApplicationFirewallCustomRule` + + +## 2.1.0 (2022-12-23) +### Features Added + +- New struct `DelegationProperties` +- New struct `PartnerManagedResourceProperties` +- New field `VirtualNetwork` in struct `BackendAddressPoolPropertiesFormat` +- New field `CustomBlockResponseBody` in struct `PolicySettings` +- New field `CustomBlockResponseStatusCode` in struct `PolicySettings` +- New field `Delegation` in struct `VirtualAppliancePropertiesFormat` +- New field `DeploymentType` in struct `VirtualAppliancePropertiesFormat` +- New field `PartnerManagedResource` in struct `VirtualAppliancePropertiesFormat` + + +## 2.0.1 (2022-10-14) +### Others Changes +- Update live test dependencies + +## 2.0.0 (2022-09-29) +### Breaking Changes + +- Const `DdosCustomPolicyProtocolSyn` has been removed +- Const `DdosCustomPolicyTriggerSensitivityOverrideHigh` has been removed +- Const `DdosSettingsProtectionCoverageBasic` has been removed +- Const `DdosCustomPolicyProtocolUDP` has been removed +- Const `DdosCustomPolicyProtocolTCP` has been removed +- Const `DdosCustomPolicyTriggerSensitivityOverrideLow` has been removed +- Const `DdosCustomPolicyTriggerSensitivityOverrideDefault` has been removed +- Const `DdosSettingsProtectionCoverageStandard` has been removed +- Const `DdosCustomPolicyTriggerSensitivityOverrideRelaxed` has been removed +- Type alias `DdosSettingsProtectionCoverage` has been removed +- Type alias `DdosCustomPolicyTriggerSensitivityOverride` has been removed +- Type alias `DdosCustomPolicyProtocol` has been removed +- Function `PossibleDdosCustomPolicyProtocolValues` has been removed +- Function `PossibleDdosSettingsProtectionCoverageValues` has been removed +- Function `PossibleDdosCustomPolicyTriggerSensitivityOverrideValues` has been removed +- Struct `ProtocolCustomSettingsFormat` has been removed +- Field `PublicIPAddresses` of struct `DdosCustomPolicyPropertiesFormat` has been removed +- Field `ProtocolCustomSettings` of struct `DdosCustomPolicyPropertiesFormat` has been removed +- Field `DdosCustomPolicy` of struct `DdosSettings` has been removed +- Field `ProtectedIP` of struct `DdosSettings` has been removed +- Field `ProtectionCoverage` of struct `DdosSettings` has been removed + +### Features Added + +- New const `ApplicationGatewayWafRuleStateTypesEnabled` +- New const `RouteMapMatchConditionNotEquals` +- New const `ActionTypeBlock` +- New const `RouteMapActionTypeUnknown` +- New const `GeoAFRI` +- New const `IsWorkloadProtectedFalse` +- New const `ApplicationGatewayRuleSetStatusOptionsDeprecated` +- New const `ApplicationGatewayWafRuleActionTypesAllow` +- New const `RouteMapActionTypeRemove` +- New const `ApplicationGatewayClientRevocationOptionsNone` +- New const `NextStepContinue` +- New const `SlotTypeProduction` +- New const `NetworkIntentPolicyBasedServiceAllowRulesOnly` +- New const `ApplicationGatewayTierTypesWAFV2` +- New const `ActionTypeLog` +- New const `CommissionedStateDeprovisioned` +- New const `RouteMapMatchConditionEquals` +- New const `GeoOCEANIA` +- New const `GeoGLOBAL` +- New const `WebApplicationFirewallTransformUppercase` +- New const `NextStepUnknown` +- New const `ApplicationGatewayTierTypesWAF` +- New const `ApplicationGatewayWafRuleActionTypesNone` +- New const `CustomIPPrefixTypeSingular` +- New const `GeoME` +- New const `GeoLATAM` +- New const `ApplicationGatewayWafRuleActionTypesBlock` +- New const `ApplicationGatewayRuleSetStatusOptionsGA` +- New const `RouteMapMatchConditionUnknown` +- New const `ApplicationGatewayWafRuleStateTypesDisabled` +- New const `ApplicationGatewayTierTypesStandardV2` +- New const `VnetLocalRouteOverrideCriteriaEqual` +- New const `ManagedRuleEnabledStateEnabled` +- New const `RouteMapMatchConditionContains` +- New const `DdosSettingsProtectionModeDisabled` +- New const `ActionTypeAnomalyScoring` +- New const `ActionTypeAllow` +- New const `SlotTypeStaging` +- New const `GeoAQ` +- New const `RouteMapMatchConditionNotContains` +- New const `ApplicationGatewayClientRevocationOptionsOCSP` +- New const `RouteMapActionTypeReplace` +- New const `GeoNAM` +- New const `CustomIPPrefixTypeChild` +- New const `GeoEURO` +- New const `ExpressRoutePortsBillingTypeMeteredData` +- New const `GeoAPAC` +- New const `CustomIPPrefixTypeParent` +- New const `VnetLocalRouteOverrideCriteriaContains` +- New const `DdosSettingsProtectionModeVirtualNetworkInherited` +- New const `ApplicationGatewayWafRuleActionTypesLog` +- New const `ApplicationGatewayWafRuleActionTypesAnomalyScoring` +- New const `ApplicationGatewayRuleSetStatusOptionsSupported` +- New const `ExpressRoutePortsBillingTypeUnlimitedData` +- New const `DdosSettingsProtectionModeEnabled` +- New const `IsWorkloadProtectedTrue` +- New const `ApplicationGatewayRuleSetStatusOptionsPreview` +- New const `RouteMapActionTypeDrop` +- New const `ApplicationGatewayTierTypesStandard` +- New const `NextStepTerminate` +- New const `RouteMapActionTypeAdd` +- New type alias `DdosSettingsProtectionMode` +- New type alias `ApplicationGatewayWafRuleActionTypes` +- New type alias `ApplicationGatewayClientRevocationOptions` +- New type alias `NextStep` +- New type alias `ActionType` +- New type alias `SlotType` +- New type alias `IsWorkloadProtected` +- New type alias `RouteMapMatchCondition` +- New type alias `ApplicationGatewayWafRuleStateTypes` +- New type alias `ApplicationGatewayTierTypes` +- New type alias `CustomIPPrefixType` +- New type alias `RouteMapActionType` +- New type alias `ExpressRoutePortsBillingType` +- New type alias `ApplicationGatewayRuleSetStatusOptions` +- New type alias `Geo` +- New type alias `VnetLocalRouteOverrideCriteria` +- New function `PossibleSlotTypeValues() []SlotType` +- New function `NewVipSwapClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VipSwapClient, error)` +- New function `PossibleNextStepValues() []NextStep` +- New function `*RouteMapsClient.BeginDelete(context.Context, string, string, string, *RouteMapsClientBeginDeleteOptions) (*runtime.Poller[RouteMapsClientDeleteResponse], error)` +- New function `PossibleRouteMapActionTypeValues() []RouteMapActionType` +- New function `*RouteMapsClient.Get(context.Context, string, string, string, *RouteMapsClientGetOptions) (RouteMapsClientGetResponse, error)` +- New function `*VirtualHubsClient.BeginGetOutboundRoutes(context.Context, string, string, GetOutboundRoutesParameters, *VirtualHubsClientBeginGetOutboundRoutesOptions) (*runtime.Poller[VirtualHubsClientGetOutboundRoutesResponse], error)` +- New function `PossibleGeoValues() []Geo` +- New function `PossibleApplicationGatewayClientRevocationOptionsValues() []ApplicationGatewayClientRevocationOptions` +- New function `*ApplicationGatewayWafDynamicManifestsClient.NewGetPager(string, *ApplicationGatewayWafDynamicManifestsClientGetOptions) *runtime.Pager[ApplicationGatewayWafDynamicManifestsClientGetResponse]` +- New function `*ApplicationGatewayWafDynamicManifestsDefaultClient.Get(context.Context, string, *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse, error)` +- New function `PossibleActionTypeValues() []ActionType` +- New function `*RouteMapsClient.NewListPager(string, string, *RouteMapsClientListOptions) *runtime.Pager[RouteMapsClientListResponse]` +- New function `PossibleApplicationGatewayTierTypesValues() []ApplicationGatewayTierTypes` +- New function `NewApplicationGatewayWafDynamicManifestsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsClient, error)` +- New function `PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGatewayRuleSetStatusOptions` +- New function `PossibleCustomIPPrefixTypeValues() []CustomIPPrefixType` +- New function `NewApplicationGatewayWafDynamicManifestsDefaultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsDefaultClient, error)` +- New function `PossibleVnetLocalRouteOverrideCriteriaValues() []VnetLocalRouteOverrideCriteria` +- New function `*VirtualHubsClient.BeginGetInboundRoutes(context.Context, string, string, GetInboundRoutesParameters, *VirtualHubsClientBeginGetInboundRoutesOptions) (*runtime.Poller[VirtualHubsClientGetInboundRoutesResponse], error)` +- New function `*VipSwapClient.Get(context.Context, string, string, *VipSwapClientGetOptions) (VipSwapClientGetResponse, error)` +- New function `*PublicIPAddressesClient.BeginDdosProtectionStatus(context.Context, string, string, *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*runtime.Poller[PublicIPAddressesClientDdosProtectionStatusResponse], error)` +- New function `PossibleExpressRoutePortsBillingTypeValues() []ExpressRoutePortsBillingType` +- New function `*VipSwapClient.List(context.Context, string, string, *VipSwapClientListOptions) (VipSwapClientListResponse, error)` +- New function `*VirtualNetworksClient.BeginListDdosProtectionStatus(context.Context, string, string, *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*runtime.Poller[*runtime.Pager[VirtualNetworksClientListDdosProtectionStatusResponse]], error)` +- New function `PossibleIsWorkloadProtectedValues() []IsWorkloadProtected` +- New function `PossibleDdosSettingsProtectionModeValues() []DdosSettingsProtectionMode` +- New function `PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWafRuleStateTypes` +- New function `NewRouteMapsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RouteMapsClient, error)` +- New function `PossibleRouteMapMatchConditionValues() []RouteMapMatchCondition` +- New function `*VipSwapClient.BeginCreate(context.Context, string, string, SwapResource, *VipSwapClientBeginCreateOptions) (*runtime.Poller[VipSwapClientCreateResponse], error)` +- New function `PossibleApplicationGatewayWafRuleActionTypesValues() []ApplicationGatewayWafRuleActionTypes` +- New function `*RouteMapsClient.BeginCreateOrUpdate(context.Context, string, string, string, RouteMap, *RouteMapsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteMapsClientCreateOrUpdateResponse], error)` +- New struct `Action` +- New struct `ApplicationGatewayFirewallManifestRuleSet` +- New struct `ApplicationGatewayWafDynamicManifestPropertiesResult` +- New struct `ApplicationGatewayWafDynamicManifestResult` +- New struct `ApplicationGatewayWafDynamicManifestResultList` +- New struct `ApplicationGatewayWafDynamicManifestsClient` +- New struct `ApplicationGatewayWafDynamicManifestsClientGetOptions` +- New struct `ApplicationGatewayWafDynamicManifestsClientGetResponse` +- New struct `ApplicationGatewayWafDynamicManifestsDefaultClient` +- New struct `ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions` +- New struct `ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse` +- New struct `Criterion` +- New struct `DefaultRuleSetPropertyFormat` +- New struct `EffectiveRouteMapRoute` +- New struct `GetInboundRoutesParameters` +- New struct `GetOutboundRoutesParameters` +- New struct `ListRouteMapsResult` +- New struct `Parameter` +- New struct `PublicIPAddressesClientBeginDdosProtectionStatusOptions` +- New struct `PublicIPAddressesClientDdosProtectionStatusResponse` +- New struct `PublicIPDdosProtectionStatusResult` +- New struct `RouteMap` +- New struct `RouteMapProperties` +- New struct `RouteMapRule` +- New struct `RouteMapsClient` +- New struct `RouteMapsClientBeginCreateOrUpdateOptions` +- New struct `RouteMapsClientBeginDeleteOptions` +- New struct `RouteMapsClientCreateOrUpdateResponse` +- New struct `RouteMapsClientDeleteResponse` +- New struct `RouteMapsClientGetOptions` +- New struct `RouteMapsClientGetResponse` +- New struct `RouteMapsClientListOptions` +- New struct `RouteMapsClientListResponse` +- New struct `StaticRoutesConfig` +- New struct `SwapResource` +- New struct `SwapResourceListResult` +- New struct `SwapResourceProperties` +- New struct `VipSwapClient` +- New struct `VipSwapClientBeginCreateOptions` +- New struct `VipSwapClientCreateResponse` +- New struct `VipSwapClientGetOptions` +- New struct `VipSwapClientGetResponse` +- New struct `VipSwapClientListOptions` +- New struct `VipSwapClientListResponse` +- New struct `VirtualHubsClientBeginGetInboundRoutesOptions` +- New struct `VirtualHubsClientBeginGetOutboundRoutesOptions` +- New struct `VirtualHubsClientGetInboundRoutesResponse` +- New struct `VirtualHubsClientGetOutboundRoutesResponse` +- New struct `VirtualNetworkDdosProtectionStatusResult` +- New struct `VirtualNetworkGatewayPolicyGroup` +- New struct `VirtualNetworkGatewayPolicyGroupMember` +- New struct `VirtualNetworkGatewayPolicyGroupProperties` +- New struct `VirtualNetworksClientBeginListDdosProtectionStatusOptions` +- New struct `VirtualNetworksClientListDdosProtectionStatusResponse` +- New struct `VngClientConnectionConfiguration` +- New struct `VngClientConnectionConfigurationProperties` +- New field `RouteMaps` in struct `VirtualHubProperties` +- New field `Tiers` in struct `ApplicationGatewayFirewallRuleSetPropertiesFormat` +- New field `EnablePrivateLinkFastPath` in struct `VirtualNetworkGatewayConnectionListEntityPropertiesFormat` +- New field `ColoLocation` in struct `ExpressRouteLinkPropertiesFormat` +- New field `EnablePrivateLinkFastPath` in struct `VirtualNetworkGatewayConnectionPropertiesFormat` +- New field `DisableTCPStateTracking` in struct `InterfacePropertiesFormat` +- New field `Top` in struct `ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions` +- New field `Action` in struct `ManagedRuleOverride` +- New field `VngClientConnectionConfigurations` in struct `VPNClientConfiguration` +- New field `StaticRoutesConfig` in struct `VnetRoute` +- New field `AllowVirtualWanTraffic` in struct `VirtualNetworkGatewayPropertiesFormat` +- New field `VirtualNetworkGatewayPolicyGroups` in struct `VirtualNetworkGatewayPropertiesFormat` +- New field `AllowRemoteVnetTraffic` in struct `VirtualNetworkGatewayPropertiesFormat` +- New field `RuleIDString` in struct `ApplicationGatewayFirewallRule` +- New field `State` in struct `ApplicationGatewayFirewallRule` +- New field `Action` in struct `ApplicationGatewayFirewallRule` +- New field `Top` in struct `ManagerDeploymentStatusClientListOptions` +- New field `InboundRouteMap` in struct `RoutingConfiguration` +- New field `OutboundRouteMap` in struct `RoutingConfiguration` +- New field `VerifyClientRevocation` in struct `ApplicationGatewayClientAuthConfiguration` +- New field `Top` in struct `ManagementClientListActiveSecurityAdminRulesOptions` +- New field `ProbeThreshold` in struct `ProbePropertiesFormat` +- New field `AllowNonVirtualWanTraffic` in struct `ExpressRouteGatewayProperties` +- New field `Top` in struct `ManagementClientListActiveConnectivityConfigurationsOptions` +- New field `PublicIPAddresses` in struct `DdosProtectionPlanPropertiesFormat` +- New field `ProtectionMode` in struct `DdosSettings` +- New field `DdosProtectionPlan` in struct `DdosSettings` +- New field `ExpressRouteAdvertise` in struct `CustomIPPrefixPropertiesFormat` +- New field `Geo` in struct `CustomIPPrefixPropertiesFormat` +- New field `PrefixType` in struct `CustomIPPrefixPropertiesFormat` +- New field `Asn` in struct `CustomIPPrefixPropertiesFormat` +- New field `Top` in struct `ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions` +- New field `EnablePrivateLinkFastPath` in struct `ExpressRouteConnectionProperties` +- New field `BillingType` in struct `ExpressRoutePortPropertiesFormat` + + +## 1.1.0 (2022-08-05) +### Features Added + +- New const `SecurityConfigurationRuleDirectionInbound` +- New const `IsGlobalFalse` +- New const `EndpointTypeAzureVMSS` +- New const `ScopeConnectionStateConflict` +- New const `SecurityConfigurationRuleDirectionOutbound` +- New const `GroupConnectivityDirectlyConnected` +- New const `ScopeConnectionStateRejected` +- New const `ConfigurationTypeConnectivity` +- New const `AutoLearnPrivateRangesModeEnabled` +- New const `UseHubGatewayFalse` +- New const `NetworkIntentPolicyBasedServiceNone` +- New const `DeleteExistingPeeringFalse` +- New const `EffectiveAdminRuleKindDefault` +- New const `DeploymentStatusFailed` +- New const `AddressPrefixTypeIPPrefix` +- New const `AddressPrefixTypeServiceTag` +- New const `UseHubGatewayTrue` +- New const `WebApplicationFirewallOperatorAny` +- New const `SecurityConfigurationRuleAccessAlwaysAllow` +- New const `CreatedByTypeUser` +- New const `EndpointTypeAzureArcVM` +- New const `DeploymentStatusNotStarted` +- New const `SecurityConfigurationRuleProtocolTCP` +- New const `SecurityConfigurationRuleAccessDeny` +- New const `SecurityConfigurationRuleProtocolEsp` +- New const `IsGlobalTrue` +- New const `DeploymentStatusDeployed` +- New const `NetworkIntentPolicyBasedServiceAll` +- New const `SecurityConfigurationRuleProtocolUDP` +- New const `CreatedByTypeKey` +- New const `PacketCaptureTargetTypeAzureVMSS` +- New const `ApplicationGatewaySSLPolicyTypeCustomV2` +- New const `DeleteExistingPeeringTrue` +- New const `ScopeConnectionStateConnected` +- New const `ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S` +- New const `ConnectivityTopologyMesh` +- New const `CreatedByTypeManagedIdentity` +- New const `AdminRuleKindCustom` +- New const `ApplicationGatewaySSLProtocolTLSv13` +- New const `ConnectivityTopologyHubAndSpoke` +- New const `ScopeConnectionStateRevoked` +- New const `ConfigurationTypeSecurityAdmin` +- New const `SecurityConfigurationRuleProtocolAh` +- New const `CommissionedStateCommissionedNoInternetAdvertise` +- New const `ScopeConnectionStatePending` +- New const `SecurityConfigurationRuleAccessAllow` +- New const `SecurityConfigurationRuleProtocolIcmp` +- New const `AutoLearnPrivateRangesModeDisabled` +- New const `SecurityConfigurationRuleProtocolAny` +- New const `ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101` +- New const `CreatedByTypeApplication` +- New const `GroupConnectivityNone` +- New const `EffectiveAdminRuleKindCustom` +- New const `AdminRuleKindDefault` +- New const `DeploymentStatusDeploying` +- New const `PacketCaptureTargetTypeAzureVM` +- New function `*ManagementClient.ListActiveConnectivityConfigurations(context.Context, string, string, ActiveConfigurationParameter, *ManagementClientListActiveConnectivityConfigurationsOptions) (ManagementClientListActiveConnectivityConfigurationsResponse, error)` +- New function `*ManagersClient.NewListBySubscriptionPager(*ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse]` +- New function `NewStaticMembersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StaticMembersClient, error)` +- New function `NewAdminRulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdminRulesClient, error)` +- New function `*EffectiveDefaultSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` +- New function `PossibleAddressPrefixTypeValues() []AddressPrefixType` +- New function `PossibleUseHubGatewayValues() []UseHubGateway` +- New function `*ScopeConnectionsClient.Delete(context.Context, string, string, string, *ScopeConnectionsClientDeleteOptions) (ScopeConnectionsClientDeleteResponse, error)` +- New function `PossibleIsGlobalValues() []IsGlobal` +- New function `*ManagementClient.ListActiveSecurityAdminRules(context.Context, string, string, ActiveConfigurationParameter, *ManagementClientListActiveSecurityAdminRulesOptions) (ManagementClientListActiveSecurityAdminRulesResponse, error)` +- New function `*ManagersClient.NewListPager(string, *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse]` +- New function `NewConnectivityConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConnectivityConfigurationsClient, error)` +- New function `*GroupsClient.Get(context.Context, string, string, string, *GroupsClientGetOptions) (GroupsClientGetResponse, error)` +- New function `PossibleAdminRuleKindValues() []AdminRuleKind` +- New function `*ScopeConnectionsClient.Get(context.Context, string, string, string, *ScopeConnectionsClientGetOptions) (ScopeConnectionsClientGetResponse, error)` +- New function `*AdminRuleCollectionsClient.CreateOrUpdate(context.Context, string, string, string, string, AdminRuleCollection, *AdminRuleCollectionsClientCreateOrUpdateOptions) (AdminRuleCollectionsClientCreateOrUpdateResponse, error)` +- New function `PossibleScopeConnectionStateValues() []ScopeConnectionState` +- New function `*ConnectivityConfigurationsClient.NewListPager(string, string, *ConnectivityConfigurationsClientListOptions) *runtime.Pager[ConnectivityConfigurationsClientListResponse]` +- New function `*BaseAdminRule.GetBaseAdminRule() *BaseAdminRule` +- New function `PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol` +- New function `*AdminRulesClient.CreateOrUpdate(context.Context, string, string, string, string, string, BaseAdminRuleClassification, *AdminRulesClientCreateOrUpdateOptions) (AdminRulesClientCreateOrUpdateResponse, error)` +- New function `PossibleNetworkIntentPolicyBasedServiceValues() []NetworkIntentPolicyBasedService` +- New function `*ManagementGroupNetworkManagerConnectionsClient.Delete(context.Context, string, string, *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (ManagementGroupNetworkManagerConnectionsClientDeleteResponse, error)` +- New function `PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess` +- New function `*ManagersClient.BeginDelete(context.Context, string, string, *ManagersClientBeginDeleteOptions) (*runtime.Poller[ManagersClientDeleteResponse], error)` +- New function `*ManagementClient.ExpressRouteProviderPort(context.Context, string, *ManagementClientExpressRouteProviderPortOptions) (ManagementClientExpressRouteProviderPortResponse, error)` +- New function `*ActiveBaseSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` +- New function `*ConnectivityConfigurationsClient.BeginDelete(context.Context, string, string, string, *ConnectivityConfigurationsClientBeginDeleteOptions) (*runtime.Poller[ConnectivityConfigurationsClientDeleteResponse], error)` +- New function `*AdminRuleCollectionsClient.BeginDelete(context.Context, string, string, string, string, *AdminRuleCollectionsClientBeginDeleteOptions) (*runtime.Poller[AdminRuleCollectionsClientDeleteResponse], error)` +- New function `*ConnectivityConfigurationsClient.CreateOrUpdate(context.Context, string, string, string, ConnectivityConfiguration, *ConnectivityConfigurationsClientCreateOrUpdateOptions) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error)` +- New function `*SecurityAdminConfigurationsClient.Get(context.Context, string, string, string, *SecurityAdminConfigurationsClientGetOptions) (SecurityAdminConfigurationsClientGetResponse, error)` +- New function `*StaticMembersClient.Delete(context.Context, string, string, string, string, *StaticMembersClientDeleteOptions) (StaticMembersClientDeleteResponse, error)` +- New function `*ManagerDeploymentStatusClient.List(context.Context, string, string, ManagerDeploymentStatusParameter, *ManagerDeploymentStatusClientListOptions) (ManagerDeploymentStatusClientListResponse, error)` +- New function `*SubscriptionNetworkManagerConnectionsClient.Delete(context.Context, string, *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (SubscriptionNetworkManagerConnectionsClientDeleteResponse, error)` +- New function `PossibleEffectiveAdminRuleKindValues() []EffectiveAdminRuleKind` +- New function `*AdminRulesClient.NewListPager(string, string, string, string, *AdminRulesClientListOptions) *runtime.Pager[AdminRulesClientListResponse]` +- New function `*GroupsClient.NewListPager(string, string, *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse]` +- New function `*GroupsClient.BeginDelete(context.Context, string, string, string, *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error)` +- New function `*StaticMembersClient.NewListPager(string, string, string, *StaticMembersClientListOptions) *runtime.Pager[StaticMembersClientListResponse]` +- New function `NewGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GroupsClient, error)` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode` +- New function `*ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate(context.Context, string, string, ManagerConnection, *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error)` +- New function `*GroupsClient.CreateOrUpdate(context.Context, string, string, string, Group, *GroupsClientCreateOrUpdateOptions) (GroupsClientCreateOrUpdateResponse, error)` +- New function `*ActiveSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` +- New function `*AdminRuleCollectionsClient.Get(context.Context, string, string, string, string, *AdminRuleCollectionsClientGetOptions) (AdminRuleCollectionsClientGetResponse, error)` +- New function `*ManagersClient.CreateOrUpdate(context.Context, string, string, Manager, *ManagersClientCreateOrUpdateOptions) (ManagersClientCreateOrUpdateResponse, error)` +- New function `*SubscriptionNetworkManagerConnectionsClient.NewListPager(*SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse]` +- New function `*AdminRule.GetBaseAdminRule() *BaseAdminRule` +- New function `*AdminRulesClient.Get(context.Context, string, string, string, string, string, *AdminRulesClientGetOptions) (AdminRulesClientGetResponse, error)` +- New function `PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType` +- New function `*ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules(context.Context, string, string, QueryRequestOptions, *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error)` +- New function `*ManagementGroupNetworkManagerConnectionsClient.Get(context.Context, string, string, *ManagementGroupNetworkManagerConnectionsClientGetOptions) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error)` +- New function `NewExpressRouteProviderPortsLocationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExpressRouteProviderPortsLocationClient, error)` +- New function `*DefaultAdminRule.GetBaseAdminRule() *BaseAdminRule` +- New function `*ConnectivityConfigurationsClient.Get(context.Context, string, string, string, *ConnectivityConfigurationsClientGetOptions) (ConnectivityConfigurationsClientGetResponse, error)` +- New function `NewManagersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagersClient, error)` +- New function `*SubscriptionNetworkManagerConnectionsClient.Get(context.Context, string, *SubscriptionNetworkManagerConnectionsClientGetOptions) (SubscriptionNetworkManagerConnectionsClientGetResponse, error)` +- New function `*EffectiveSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` +- New function `*EffectiveBaseSecurityAdminRule.GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule` +- New function `NewScopeConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ScopeConnectionsClient, error)` +- New function `NewAdminRuleCollectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AdminRuleCollectionsClient, error)` +- New function `*ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations(context.Context, string, string, QueryRequestOptions, *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error)` +- New function `PossibleGroupConnectivityValues() []GroupConnectivity` +- New function `NewSubscriptionNetworkManagerConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SubscriptionNetworkManagerConnectionsClient, error)` +- New function `*AzureFirewallsClient.BeginListLearnedPrefixes(context.Context, string, string, *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*runtime.Poller[AzureFirewallsClientListLearnedPrefixesResponse], error)` +- New function `*ManagersClient.Patch(context.Context, string, string, PatchObject, *ManagersClientPatchOptions) (ManagersClientPatchResponse, error)` +- New function `*ManagersClient.Get(context.Context, string, string, *ManagersClientGetOptions) (ManagersClientGetResponse, error)` +- New function `*StaticMembersClient.CreateOrUpdate(context.Context, string, string, string, string, StaticMember, *StaticMembersClientCreateOrUpdateOptions) (StaticMembersClientCreateOrUpdateResponse, error)` +- New function `*AdminRuleCollectionsClient.NewListPager(string, string, string, *AdminRuleCollectionsClientListOptions) *runtime.Pager[AdminRuleCollectionsClientListResponse]` +- New function `*ScopeConnectionsClient.NewListPager(string, string, *ScopeConnectionsClientListOptions) *runtime.Pager[ScopeConnectionsClientListResponse]` +- New function `*ActiveDefaultSecurityAdminRule.GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule` +- New function `*ExpressRouteProviderPortsLocationClient.List(context.Context, *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error)` +- New function `*ManagerCommitsClient.BeginPost(context.Context, string, string, ManagerCommit, *ManagerCommitsClientBeginPostOptions) (*runtime.Poller[ManagerCommitsClientPostResponse], error)` +- New function `NewManagerCommitsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagerCommitsClient, error)` +- New function `PossibleConfigurationTypeValues() []ConfigurationType` +- New function `NewManagerDeploymentStatusClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagerDeploymentStatusClient, error)` +- New function `*ScopeConnectionsClient.CreateOrUpdate(context.Context, string, string, string, ScopeConnection, *ScopeConnectionsClientCreateOrUpdateOptions) (ScopeConnectionsClientCreateOrUpdateResponse, error)` +- New function `*SecurityAdminConfigurationsClient.CreateOrUpdate(context.Context, string, string, string, SecurityAdminConfiguration, *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error)` +- New function `NewManagementGroupNetworkManagerConnectionsClient(azcore.TokenCredential, *arm.ClientOptions) (*ManagementGroupNetworkManagerConnectionsClient, error)` +- New function `PossibleDeleteExistingPeeringValues() []DeleteExistingPeering` +- New function `PossibleDeploymentStatusValues() []DeploymentStatus` +- New function `*ManagementGroupNetworkManagerConnectionsClient.NewListPager(string, *ManagementGroupNetworkManagerConnectionsClientListOptions) *runtime.Pager[ManagementGroupNetworkManagerConnectionsClientListResponse]` +- New function `*SecurityAdminConfigurationsClient.NewListPager(string, string, *SecurityAdminConfigurationsClientListOptions) *runtime.Pager[SecurityAdminConfigurationsClientListResponse]` +- New function `PossibleConnectivityTopologyValues() []ConnectivityTopology` +- New function `*StaticMembersClient.Get(context.Context, string, string, string, string, *StaticMembersClientGetOptions) (StaticMembersClientGetResponse, error)` +- New function `PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection` +- New function `*SecurityAdminConfigurationsClient.BeginDelete(context.Context, string, string, string, *SecurityAdminConfigurationsClientBeginDeleteOptions) (*runtime.Poller[SecurityAdminConfigurationsClientDeleteResponse], error)` +- New function `NewSecurityAdminConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityAdminConfigurationsClient, error)` +- New function `*AdminRulesClient.BeginDelete(context.Context, string, string, string, string, string, *AdminRulesClientBeginDeleteOptions) (*runtime.Poller[AdminRulesClientDeleteResponse], error)` +- New function `*SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate(context.Context, string, ManagerConnection, *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error)` +- New struct `ActiveBaseSecurityAdminRule` +- New struct `ActiveConfigurationParameter` +- New struct `ActiveConnectivityConfiguration` +- New struct `ActiveConnectivityConfigurationsListResult` +- New struct `ActiveDefaultSecurityAdminRule` +- New struct `ActiveSecurityAdminRule` +- New struct `ActiveSecurityAdminRulesListResult` +- New struct `AddressPrefixItem` +- New struct `AdminPropertiesFormat` +- New struct `AdminRule` +- New struct `AdminRuleCollection` +- New struct `AdminRuleCollectionListResult` +- New struct `AdminRuleCollectionPropertiesFormat` +- New struct `AdminRuleCollectionsClient` +- New struct `AdminRuleCollectionsClientBeginDeleteOptions` +- New struct `AdminRuleCollectionsClientCreateOrUpdateOptions` +- New struct `AdminRuleCollectionsClientCreateOrUpdateResponse` +- New struct `AdminRuleCollectionsClientDeleteResponse` +- New struct `AdminRuleCollectionsClientGetOptions` +- New struct `AdminRuleCollectionsClientGetResponse` +- New struct `AdminRuleCollectionsClientListOptions` +- New struct `AdminRuleCollectionsClientListResponse` +- New struct `AdminRuleListResult` +- New struct `AdminRulesClient` +- New struct `AdminRulesClientBeginDeleteOptions` +- New struct `AdminRulesClientCreateOrUpdateOptions` +- New struct `AdminRulesClientCreateOrUpdateResponse` +- New struct `AdminRulesClientDeleteResponse` +- New struct `AdminRulesClientGetOptions` +- New struct `AdminRulesClientGetResponse` +- New struct `AdminRulesClientListOptions` +- New struct `AdminRulesClientListResponse` +- New struct `AzureFirewallsClientBeginListLearnedPrefixesOptions` +- New struct `AzureFirewallsClientListLearnedPrefixesResponse` +- New struct `BaseAdminRule` +- New struct `ChildResource` +- New struct `ConfigurationGroup` +- New struct `ConnectivityConfiguration` +- New struct `ConnectivityConfigurationListResult` +- New struct `ConnectivityConfigurationProperties` +- New struct `ConnectivityConfigurationsClient` +- New struct `ConnectivityConfigurationsClientBeginDeleteOptions` +- New struct `ConnectivityConfigurationsClientCreateOrUpdateOptions` +- New struct `ConnectivityConfigurationsClientCreateOrUpdateResponse` +- New struct `ConnectivityConfigurationsClientDeleteResponse` +- New struct `ConnectivityConfigurationsClientGetOptions` +- New struct `ConnectivityConfigurationsClientGetResponse` +- New struct `ConnectivityConfigurationsClientListOptions` +- New struct `ConnectivityConfigurationsClientListResponse` +- New struct `ConnectivityGroupItem` +- New struct `CrossTenantScopes` +- New struct `DefaultAdminPropertiesFormat` +- New struct `DefaultAdminRule` +- New struct `EffectiveBaseSecurityAdminRule` +- New struct `EffectiveConnectivityConfiguration` +- New struct `EffectiveDefaultSecurityAdminRule` +- New struct `EffectiveSecurityAdminRule` +- New struct `ExpressRouteProviderPort` +- New struct `ExpressRouteProviderPortListResult` +- New struct `ExpressRouteProviderPortProperties` +- New struct `ExpressRouteProviderPortsLocationClient` +- New struct `ExpressRouteProviderPortsLocationClientListOptions` +- New struct `ExpressRouteProviderPortsLocationClientListResponse` +- New struct `Group` +- New struct `GroupListResult` +- New struct `GroupProperties` +- New struct `GroupsClient` +- New struct `GroupsClientBeginDeleteOptions` +- New struct `GroupsClientCreateOrUpdateOptions` +- New struct `GroupsClientCreateOrUpdateResponse` +- New struct `GroupsClientDeleteResponse` +- New struct `GroupsClientGetOptions` +- New struct `GroupsClientGetResponse` +- New struct `GroupsClientListOptions` +- New struct `GroupsClientListResponse` +- New struct `Hub` +- New struct `IPPrefixesList` +- New struct `ManagementClientExpressRouteProviderPortOptions` +- New struct `ManagementClientExpressRouteProviderPortResponse` +- New struct `ManagementClientListActiveConnectivityConfigurationsOptions` +- New struct `ManagementClientListActiveConnectivityConfigurationsResponse` +- New struct `ManagementClientListActiveSecurityAdminRulesOptions` +- New struct `ManagementClientListActiveSecurityAdminRulesResponse` +- New struct `ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions` +- New struct `ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse` +- New struct `ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions` +- New struct `ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse` +- New struct `ManagementGroupNetworkManagerConnectionsClient` +- New struct `ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions` +- New struct `ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse` +- New struct `ManagementGroupNetworkManagerConnectionsClientDeleteOptions` +- New struct `ManagementGroupNetworkManagerConnectionsClientDeleteResponse` +- New struct `ManagementGroupNetworkManagerConnectionsClientGetOptions` +- New struct `ManagementGroupNetworkManagerConnectionsClientGetResponse` +- New struct `ManagementGroupNetworkManagerConnectionsClientListOptions` +- New struct `ManagementGroupNetworkManagerConnectionsClientListResponse` +- New struct `Manager` +- New struct `ManagerCommit` +- New struct `ManagerCommitsClient` +- New struct `ManagerCommitsClientBeginPostOptions` +- New struct `ManagerCommitsClientPostResponse` +- New struct `ManagerConnection` +- New struct `ManagerConnectionListResult` +- New struct `ManagerConnectionProperties` +- New struct `ManagerDeploymentStatus` +- New struct `ManagerDeploymentStatusClient` +- New struct `ManagerDeploymentStatusClientListOptions` +- New struct `ManagerDeploymentStatusClientListResponse` +- New struct `ManagerDeploymentStatusListResult` +- New struct `ManagerDeploymentStatusParameter` +- New struct `ManagerEffectiveConnectivityConfigurationListResult` +- New struct `ManagerEffectiveSecurityAdminRulesListResult` +- New struct `ManagerListResult` +- New struct `ManagerProperties` +- New struct `ManagerPropertiesNetworkManagerScopes` +- New struct `ManagerSecurityGroupItem` +- New struct `ManagersClient` +- New struct `ManagersClientBeginDeleteOptions` +- New struct `ManagersClientCreateOrUpdateOptions` +- New struct `ManagersClientCreateOrUpdateResponse` +- New struct `ManagersClientDeleteResponse` +- New struct `ManagersClientGetOptions` +- New struct `ManagersClientGetResponse` +- New struct `ManagersClientListBySubscriptionOptions` +- New struct `ManagersClientListBySubscriptionResponse` +- New struct `ManagersClientListOptions` +- New struct `ManagersClientListResponse` +- New struct `ManagersClientPatchOptions` +- New struct `ManagersClientPatchResponse` +- New struct `PacketCaptureMachineScope` +- New struct `PatchObject` +- New struct `QueryRequestOptions` +- New struct `ScopeConnection` +- New struct `ScopeConnectionListResult` +- New struct `ScopeConnectionProperties` +- New struct `ScopeConnectionsClient` +- New struct `ScopeConnectionsClientCreateOrUpdateOptions` +- New struct `ScopeConnectionsClientCreateOrUpdateResponse` +- New struct `ScopeConnectionsClientDeleteOptions` +- New struct `ScopeConnectionsClientDeleteResponse` +- New struct `ScopeConnectionsClientGetOptions` +- New struct `ScopeConnectionsClientGetResponse` +- New struct `ScopeConnectionsClientListOptions` +- New struct `ScopeConnectionsClientListResponse` +- New struct `SecurityAdminConfiguration` +- New struct `SecurityAdminConfigurationListResult` +- New struct `SecurityAdminConfigurationPropertiesFormat` +- New struct `SecurityAdminConfigurationsClient` +- New struct `SecurityAdminConfigurationsClientBeginDeleteOptions` +- New struct `SecurityAdminConfigurationsClientCreateOrUpdateOptions` +- New struct `SecurityAdminConfigurationsClientCreateOrUpdateResponse` +- New struct `SecurityAdminConfigurationsClientDeleteResponse` +- New struct `SecurityAdminConfigurationsClientGetOptions` +- New struct `SecurityAdminConfigurationsClientGetResponse` +- New struct `SecurityAdminConfigurationsClientListOptions` +- New struct `SecurityAdminConfigurationsClientListResponse` +- New struct `StaticMember` +- New struct `StaticMemberListResult` +- New struct `StaticMemberProperties` +- New struct `StaticMembersClient` +- New struct `StaticMembersClientCreateOrUpdateOptions` +- New struct `StaticMembersClientCreateOrUpdateResponse` +- New struct `StaticMembersClientDeleteOptions` +- New struct `StaticMembersClientDeleteResponse` +- New struct `StaticMembersClientGetOptions` +- New struct `StaticMembersClientGetResponse` +- New struct `StaticMembersClientListOptions` +- New struct `StaticMembersClientListResponse` +- New struct `SubscriptionNetworkManagerConnectionsClient` +- New struct `SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions` +- New struct `SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse` +- New struct `SubscriptionNetworkManagerConnectionsClientDeleteOptions` +- New struct `SubscriptionNetworkManagerConnectionsClientDeleteResponse` +- New struct `SubscriptionNetworkManagerConnectionsClientGetOptions` +- New struct `SubscriptionNetworkManagerConnectionsClientGetResponse` +- New struct `SubscriptionNetworkManagerConnectionsClientListOptions` +- New struct `SubscriptionNetworkManagerConnectionsClientListResponse` +- New struct `SystemData` +- New struct `VirtualRouterAutoScaleConfiguration` +- New field `NoInternetAdvertise` in struct `CustomIPPrefixPropertiesFormat` +- New field `FlushConnection` in struct `SecurityGroupPropertiesFormat` +- New field `EnablePacFile` in struct `ExplicitProxySettings` +- New field `Scope` in struct `PacketCaptureParameters` +- New field `TargetType` in struct `PacketCaptureParameters` +- New field `Scope` in struct `PacketCaptureResultProperties` +- New field `TargetType` in struct `PacketCaptureResultProperties` +- New field `AutoLearnPrivateRanges` in struct `FirewallPolicySNAT` +- New field `VirtualRouterAutoScaleConfiguration` in struct `VirtualHubProperties` +- New field `Priority` in struct `ApplicationGatewayRoutingRulePropertiesFormat` + + +## 1.0.0 (2022-05-16) + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork` 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). diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/LICENSE.txt new file mode 100644 index 00000000000..dc0c2ffb3dc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/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/network/armnetwork/v2/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/README.md new file mode 100644 index 00000000000..8ffb5332b45 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/README.md @@ -0,0 +1,94 @@ +# Azure Network Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2) + +The `armnetwork` module provides operations for working with Azure Network. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/network/armnetwork) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.18 or above (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 Network module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Network. 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 Network 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 := armnetwork.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 := armnetwork.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.NewVirtualHubBgpConnectionsClient() +``` + +## More sample code + +- [IP Address](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/ipaddress) +- [Load Balancer](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/loadbalancer) +- [Network Interface](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/networkInterface) +- [Security Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/securitygroups) +- [Subnet](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/subnets) +- [Virtual Network](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/network/virtualnetwork) + +## 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 `Network` 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. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrulecollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrulecollections_client.go new file mode 100644 index 00000000000..d09b9f0cff6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrulecollections_client.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AdminRuleCollectionsClient contains the methods for the AdminRuleCollections group. +// Don't use this type directly, use NewAdminRuleCollectionsClient() instead. +type AdminRuleCollectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAdminRuleCollectionsClient creates a new instance of AdminRuleCollectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAdminRuleCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRuleCollectionsClient, error) { + cl, err := arm.NewClient(moduleName+".AdminRuleCollectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AdminRuleCollectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates an admin rule collection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - ruleCollection - The Rule Collection to create or update +// - options - AdminRuleCollectionsClientCreateOrUpdateOptions contains the optional parameters for the AdminRuleCollectionsClient.CreateOrUpdate +// method. +func (client *AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, options *AdminRuleCollectionsClientCreateOrUpdateOptions) (AdminRuleCollectionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection, options) + if err != nil { + return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AdminRuleCollectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, options *AdminRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, ruleCollection) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AdminRuleCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (AdminRuleCollectionsClientCreateOrUpdateResponse, error) { + result := AdminRuleCollectionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollection); err != nil { + return AdminRuleCollectionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes an admin rule collection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - options - AdminRuleCollectionsClientBeginDeleteOptions contains the optional parameters for the AdminRuleCollectionsClient.BeginDelete +// method. +func (client *AdminRuleCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*runtime.Poller[AdminRuleCollectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdminRuleCollectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AdminRuleCollectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes an admin rule collection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AdminRuleCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a network manager security admin configuration rule collection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - options - AdminRuleCollectionsClientGetOptions contains the optional parameters for the AdminRuleCollectionsClient.Get +// method. +func (client *AdminRuleCollectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientGetOptions) (AdminRuleCollectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) + if err != nil { + return AdminRuleCollectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRuleCollectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AdminRuleCollectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AdminRuleCollectionsClient) getHandleResponse(resp *http.Response) (AdminRuleCollectionsClientGetResponse, error) { + result := AdminRuleCollectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollection); err != nil { + return AdminRuleCollectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the rule collections in a security admin configuration, in a paginated format. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - options - AdminRuleCollectionsClientListOptions contains the optional parameters for the AdminRuleCollectionsClient.NewListPager +// method. +func (client *AdminRuleCollectionsClient) NewListPager(resourceGroupName string, networkManagerName string, configurationName string, options *AdminRuleCollectionsClientListOptions) *runtime.Pager[AdminRuleCollectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AdminRuleCollectionsClientListResponse]{ + More: func(page AdminRuleCollectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AdminRuleCollectionsClientListResponse) (AdminRuleCollectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AdminRuleCollectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRuleCollectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AdminRuleCollectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AdminRuleCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *AdminRuleCollectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AdminRuleCollectionsClient) listHandleResponse(resp *http.Response) (AdminRuleCollectionsClientListResponse, error) { + result := AdminRuleCollectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleCollectionListResult); err != nil { + return AdminRuleCollectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrules_client.go new file mode 100644 index 00000000000..6dd3543649d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/adminrules_client.go @@ -0,0 +1,362 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AdminRulesClient contains the methods for the AdminRules group. +// Don't use this type directly, use NewAdminRulesClient() instead. +type AdminRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAdminRulesClient creates a new instance of AdminRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAdminRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminRulesClient, error) { + cl, err := arm.NewClient(moduleName+".AdminRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AdminRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates an admin rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - ruleName - The name of the rule. +// - adminRule - The admin rule to create or update +// - options - AdminRulesClientCreateOrUpdateOptions contains the optional parameters for the AdminRulesClient.CreateOrUpdate +// method. +func (client *AdminRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, options *AdminRulesClientCreateOrUpdateOptions) (AdminRulesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, adminRule, options) + if err != nil { + return AdminRulesClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRulesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AdminRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, options *AdminRulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, adminRule) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AdminRulesClient) createOrUpdateHandleResponse(resp *http.Response) (AdminRulesClientCreateOrUpdateResponse, error) { + result := AdminRulesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return AdminRulesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes an admin rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - ruleName - The name of the rule. +// - options - AdminRulesClientBeginDeleteOptions contains the optional parameters for the AdminRulesClient.BeginDelete method. +func (client *AdminRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*runtime.Poller[AdminRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdminRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AdminRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes an admin rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AdminRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a network manager security configuration admin rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - ruleName - The name of the rule. +// - options - AdminRulesClientGetOptions contains the optional parameters for the AdminRulesClient.Get method. +func (client *AdminRulesClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientGetOptions) (AdminRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, options) + if err != nil { + return AdminRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AdminRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRulesClientGetResponse, error) { + result := AdminRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return AdminRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all network manager security configuration admin rules. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - ruleCollectionName - The name of the network manager security Configuration rule collection. +// - options - AdminRulesClientListOptions contains the optional parameters for the AdminRulesClient.NewListPager method. +func (client *AdminRulesClient) NewListPager(resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRulesClientListOptions) *runtime.Pager[AdminRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AdminRulesClientListResponse]{ + More: func(page AdminRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AdminRulesClientListResponse) (AdminRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AdminRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AdminRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AdminRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AdminRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AdminRulesClient) listHandleResponse(resp *http.Response) (AdminRulesClientListResponse, error) { + result := AdminRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdminRuleListResult); err != nil { + return AdminRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivateendpointconnections_client.go new file mode 100644 index 00000000000..de02ae41004 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivateendpointconnections_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationGatewayPrivateEndpointConnectionsClient contains the methods for the ApplicationGatewayPrivateEndpointConnections group. +// Don't use this type directly, use NewApplicationGatewayPrivateEndpointConnectionsClient() instead. +type ApplicationGatewayPrivateEndpointConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationGatewayPrivateEndpointConnectionsClient creates a new instance of ApplicationGatewayPrivateEndpointConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateEndpointConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationGatewayPrivateEndpointConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationGatewayPrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Deletes the specified private endpoint connection on application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - connectionName - The name of the application gateway private endpoint connection. +// - options - ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the +// ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete method. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, applicationGatewayName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified private endpoint connection on application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified private endpoint connection on application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - connectionName - The name of the application gateway private endpoint connection. +// - options - ApplicationGatewayPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.Get +// method. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (ApplicationGatewayPrivateEndpointConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, options) + if err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (ApplicationGatewayPrivateEndpointConnectionsClientGetResponse, error) { + result := ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateEndpointConnection); err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all private endpoint connections on an application gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager +// method. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) *runtime.Pager[ApplicationGatewayPrivateEndpointConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewayPrivateEndpointConnectionsClientListResponse]{ + More: func(page ApplicationGatewayPrivateEndpointConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewayPrivateEndpointConnectionsClientListResponse) (ApplicationGatewayPrivateEndpointConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (ApplicationGatewayPrivateEndpointConnectionsClientListResponse, error) { + result := ApplicationGatewayPrivateEndpointConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateEndpointConnectionListResult); err != nil { + return ApplicationGatewayPrivateEndpointConnectionsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates the specified private endpoint connection on application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - connectionName - The name of the application gateway private endpoint connection. +// - parameters - Parameters supplied to update application gateway private endpoint connection operation. +// - options - ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the +// ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate method. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Updates the specified private endpoint connection on application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivatelinkresources_client.go new file mode 100644 index 00000000000..8e704f721f2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewayprivatelinkresources_client.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationGatewayPrivateLinkResourcesClient contains the methods for the ApplicationGatewayPrivateLinkResources group. +// Don't use this type directly, use NewApplicationGatewayPrivateLinkResourcesClient() instead. +type ApplicationGatewayPrivateLinkResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationGatewayPrivateLinkResourcesClient creates a new instance of ApplicationGatewayPrivateLinkResourcesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayPrivateLinkResourcesClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationGatewayPrivateLinkResourcesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationGatewayPrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Lists all private link resources on an application gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.NewListPager +// method. +func (client *ApplicationGatewayPrivateLinkResourcesClient) NewListPager(resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateLinkResourcesClientListOptions) *runtime.Pager[ApplicationGatewayPrivateLinkResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewayPrivateLinkResourcesClientListResponse]{ + More: func(page ApplicationGatewayPrivateLinkResourcesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewayPrivateLinkResourcesClientListResponse) (ApplicationGatewayPrivateLinkResourcesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ApplicationGatewayPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (ApplicationGatewayPrivateLinkResourcesClientListResponse, error) { + result := ApplicationGatewayPrivateLinkResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayPrivateLinkResourceListResult); err != nil { + return ApplicationGatewayPrivateLinkResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgateways_client.go new file mode 100644 index 00000000000..6773ca68898 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgateways_client.go @@ -0,0 +1,1052 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationGatewaysClient contains the methods for the ApplicationGateways group. +// Don't use this type directly, use NewApplicationGatewaysClient() instead. +type ApplicationGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationGatewaysClient creates a new instance of ApplicationGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginBackendHealth - Gets the backend health of the specified application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth +// method. +func (client *ApplicationGatewaysClient) BeginBackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*runtime.Poller[ApplicationGatewaysClientBackendHealthResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.backendHealth(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientBackendHealthResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// BackendHealth - Gets the backend health of the specified application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { + req, err := client.backendHealthCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// backendHealthCreateRequest creates the BackendHealth request. +func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginBackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified +// application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - probeRequest - Request body for on-demand test probe operation. +// - options - ApplicationGatewaysClientBeginBackendHealthOnDemandOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealthOnDemand +// method. +func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*runtime.Poller[ApplicationGatewaysClientBackendHealthOnDemandResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.backendHealthOnDemand(ctx, resourceGroupName, applicationGatewayName, probeRequest, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientBackendHealthOnDemandResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientBackendHealthOnDemandResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// BackendHealthOnDemand - Gets the backend health for given combination of backend pool and http setting of the specified +// application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) backendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*http.Response, error) { + req, err := client.backendHealthOnDemandCreateRequest(ctx, resourceGroupName, applicationGatewayName, probeRequest, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// backendHealthOnDemandCreateRequest creates the BackendHealthOnDemand request. +func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, options *ApplicationGatewaysClientBeginBackendHealthOnDemandOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, probeRequest) +} + +// BeginCreateOrUpdate - Creates or updates the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - parameters - Parameters supplied to the create or update application gateway operation. +// - options - ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate +// method. +func (client *ApplicationGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, applicationGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete +// method. +func (client *ApplicationGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*runtime.Poller[ApplicationGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. +func (client *ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (ApplicationGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return ApplicationGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationGatewaysClient) getHandleResponse(resp *http.Response) (ApplicationGatewaysClientGetResponse, error) { + result := ApplicationGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGateway); err != nil { + return ApplicationGatewaysClientGetResponse{}, err + } + return result, nil +} + +// GetSSLPredefinedPolicy - Gets Ssl predefined policy with the specified policy name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - predefinedPolicyName - Name of Ssl predefined policy. +// - options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy +// method. +func (client *ApplicationGatewaysClient) GetSSLPredefinedPolicy(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (ApplicationGatewaysClientGetSSLPredefinedPolicyResponse, error) { + req, err := client.getSSLPredefinedPolicyCreateRequest(ctx, predefinedPolicyName, options) + if err != nil { + return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, runtime.NewResponseError(resp) + } + return client.getSSLPredefinedPolicyHandleResponse(resp) +} + +// getSSLPredefinedPolicyCreateRequest creates the GetSSLPredefinedPolicy request. +func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if predefinedPolicyName == "" { + return nil, errors.New("parameter predefinedPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{predefinedPolicyName}", url.PathEscape(predefinedPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getSSLPredefinedPolicyHandleResponse handles the GetSSLPredefinedPolicy response. +func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(resp *http.Response) (ApplicationGatewaysClientGetSSLPredefinedPolicyResponse, error) { + result := ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewaySSLPredefinedPolicy); err != nil { + return ApplicationGatewaysClientGetSSLPredefinedPolicyResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all application gateways in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager +// method. +func (client *ApplicationGatewaysClient) NewListPager(resourceGroupName string, options *ApplicationGatewaysClientListOptions) *runtime.Pager[ApplicationGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListResponse]{ + More: func(page ApplicationGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListResponse) (ApplicationGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) (ApplicationGatewaysClientListResponse, error) { + result := ApplicationGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayListResult); err != nil { + return ApplicationGatewaysClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the application gateways in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager +// method. +func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListAllResponse]{ + More: func(page ApplicationGatewaysClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListAllResponse) (ApplicationGatewaysClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewaysClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *ApplicationGatewaysClient) listAllHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAllResponse, error) { + result := ApplicationGatewaysClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayListResult); err != nil { + return ApplicationGatewaysClientListAllResponse{}, err + } + return result, nil +} + +// ListAvailableRequestHeaders - Lists all available request headers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders +// method. +func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { + req, err := client.listAvailableRequestHeadersCreateRequest(ctx, options) + if err != nil { + return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableRequestHeadersHandleResponse(resp) +} + +// listAvailableRequestHeadersCreateRequest creates the ListAvailableRequestHeaders request. +func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableRequestHeadersHandleResponse handles the ListAvailableRequestHeaders response. +func (client *ApplicationGatewaysClient) listAvailableRequestHeadersHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { + result := ApplicationGatewaysClientListAvailableRequestHeadersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { + return ApplicationGatewaysClientListAvailableRequestHeadersResponse{}, err + } + return result, nil +} + +// ListAvailableResponseHeaders - Lists all available response headers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders +// method. +func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { + req, err := client.listAvailableResponseHeadersCreateRequest(ctx, options) + if err != nil { + return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableResponseHeadersHandleResponse(resp) +} + +// listAvailableResponseHeadersCreateRequest creates the ListAvailableResponseHeaders request. +func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableResponseHeadersHandleResponse handles the ListAvailableResponseHeaders response. +func (client *ApplicationGatewaysClient) listAvailableResponseHeadersHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { + result := ApplicationGatewaysClientListAvailableResponseHeadersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { + return ApplicationGatewaysClientListAvailableResponseHeadersResponse{}, err + } + return result, nil +} + +// ListAvailableSSLOptions - Lists available Ssl options for configuring Ssl policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions +// method. +func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { + req, err := client.listAvailableSSLOptionsCreateRequest(ctx, options) + if err != nil { + return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableSSLOptionsHandleResponse(resp) +} + +// listAvailableSSLOptionsCreateRequest creates the ListAvailableSSLOptions request. +func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableSSLOptionsHandleResponse handles the ListAvailableSSLOptions response. +func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { + result := ApplicationGatewaysClientListAvailableSSLOptionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableSSLOptions); err != nil { + return ApplicationGatewaysClientListAvailableSSLOptionsResponse{}, err + } + return result, nil +} + +// NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager +// method. +func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse]{ + More: func(page ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse) (ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAvailableSSLPredefinedPoliciesCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableSSLPredefinedPoliciesHandleResponse(resp) + }, + }) +} + +// listAvailableSSLPredefinedPoliciesCreateRequest creates the ListAvailableSSLPredefinedPolicies request. +func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableSSLPredefinedPoliciesHandleResponse handles the ListAvailableSSLPredefinedPolicies response. +func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse, error) { + result := ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableSSLPredefinedPolicies); err != nil { + return ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse{}, err + } + return result, nil +} + +// ListAvailableServerVariables - Lists all available server variables. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables +// method. +func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { + req, err := client.listAvailableServerVariablesCreateRequest(ctx, options) + if err != nil { + return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableServerVariablesHandleResponse(resp) +} + +// listAvailableServerVariablesCreateRequest creates the ListAvailableServerVariables request. +func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableServerVariablesHandleResponse handles the ListAvailableServerVariables response. +func (client *ApplicationGatewaysClient) listAvailableServerVariablesHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { + result := ApplicationGatewaysClientListAvailableServerVariablesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil { + return ApplicationGatewaysClientListAvailableServerVariablesResponse{}, err + } + return result, nil +} + +// ListAvailableWafRuleSets - Lists all available web application firewall rule sets. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets +// method. +func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { + req, err := client.listAvailableWafRuleSetsCreateRequest(ctx, options) + if err != nil { + return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableWafRuleSetsHandleResponse(resp) +} + +// listAvailableWafRuleSetsCreateRequest creates the ListAvailableWafRuleSets request. +func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableWafRuleSetsHandleResponse handles the ListAvailableWafRuleSets response. +func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsHandleResponse(resp *http.Response) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { + result := ApplicationGatewaysClientListAvailableWafRuleSetsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayAvailableWafRuleSetsResult); err != nil { + return ApplicationGatewaysClientListAvailableWafRuleSetsResponse{}, err + } + return result, nil +} + +// BeginStart - Starts the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart +// method. +func (client *ApplicationGatewaysClient) BeginStart(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*runtime.Poller[ApplicationGatewaysClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Start - Starts the specified application gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Stops the specified application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - options - ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop +// method. +func (client *ApplicationGatewaysClient) BeginStop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*runtime.Poller[ApplicationGatewaysClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationGatewaysClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationGatewaysClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Stop - Stops the specified application gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, applicationGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// UpdateTags - Updates the specified application gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationGatewayName - The name of the application gateway. +// - parameters - Parameters supplied to update application gateway tags. +// - options - ApplicationGatewaysClientUpdateTagsOptions contains the optional parameters for the ApplicationGatewaysClient.UpdateTags +// method. +func (client *ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject, options *ApplicationGatewaysClientUpdateTagsOptions) (ApplicationGatewaysClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, applicationGatewayName, parameters, options) + if err != nil { + return ApplicationGatewaysClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewaysClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject, options *ApplicationGatewaysClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationGatewayName == "" { + return nil, errors.New("parameter applicationGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGatewayName}", url.PathEscape(applicationGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ApplicationGatewaysClient) updateTagsHandleResponse(resp *http.Response) (ApplicationGatewaysClientUpdateTagsResponse, error) { + result := ApplicationGatewaysClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGateway); err != nil { + return ApplicationGatewaysClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifests_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifests_client.go new file mode 100644 index 00000000000..0f7d39f2bcd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifests_client.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationGatewayWafDynamicManifestsClient contains the methods for the ApplicationGatewayWafDynamicManifests group. +// Don't use this type directly, use NewApplicationGatewayWafDynamicManifestsClient() instead. +type ApplicationGatewayWafDynamicManifestsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationGatewayWafDynamicManifestsClient creates a new instance of ApplicationGatewayWafDynamicManifestsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationGatewayWafDynamicManifestsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationGatewayWafDynamicManifestsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewGetPager - Gets the regional application gateway waf manifest. +// +// Generated from API version 2022-09-01 +// - location - The region where the nrp are located at. +// - options - ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager +// method. +func (client *ApplicationGatewayWafDynamicManifestsClient) NewGetPager(location string, options *ApplicationGatewayWafDynamicManifestsClientGetOptions) *runtime.Pager[ApplicationGatewayWafDynamicManifestsClientGetResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGatewayWafDynamicManifestsClientGetResponse]{ + More: func(page ApplicationGatewayWafDynamicManifestsClientGetResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGatewayWafDynamicManifestsClientGetResponse) (ApplicationGatewayWafDynamicManifestsClientGetResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.getCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGatewayWafDynamicManifestsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewayWafDynamicManifestsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewayWafDynamicManifestsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) + }, + }) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationGatewayWafDynamicManifestsClient) getHandleResponse(resp *http.Response) (ApplicationGatewayWafDynamicManifestsClientGetResponse, error) { + result := ApplicationGatewayWafDynamicManifestsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayWafDynamicManifestResultList); err != nil { + return ApplicationGatewayWafDynamicManifestsClientGetResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifestsdefault_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifestsdefault_client.go new file mode 100644 index 00000000000..99797e22ef1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationgatewaywafdynamicmanifestsdefault_client.go @@ -0,0 +1,99 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationGatewayWafDynamicManifestsDefaultClient contains the methods for the ApplicationGatewayWafDynamicManifestsDefault group. +// Don't use this type directly, use NewApplicationGatewayWafDynamicManifestsDefaultClient() instead. +type ApplicationGatewayWafDynamicManifestsDefaultClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationGatewayWafDynamicManifestsDefaultClient creates a new instance of ApplicationGatewayWafDynamicManifestsDefaultClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGatewayWafDynamicManifestsDefaultClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationGatewayWafDynamicManifestsDefaultClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationGatewayWafDynamicManifestsDefaultClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the regional application gateway waf manifest. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The region where the nrp are located at. +// - options - ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsDefaultClient.Get +// method. +func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, location, options) + if err != nil { + return ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getCreateRequest(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getHandleResponse(resp *http.Response) (ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse, error) { + result := ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGatewayWafDynamicManifestResult); err != nil { + return ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationsecuritygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationsecuritygroups_client.go new file mode 100644 index 00000000000..51adf8360f6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/applicationsecuritygroups_client.go @@ -0,0 +1,423 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ApplicationSecurityGroupsClient contains the methods for the ApplicationSecurityGroups group. +// Don't use this type directly, use NewApplicationSecurityGroupsClient() instead. +type ApplicationSecurityGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationSecurityGroupsClient creates a new instance of ApplicationSecurityGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApplicationSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationSecurityGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationSecurityGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationSecurityGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an application security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationSecurityGroupName - The name of the application security group. +// - parameters - Parameters supplied to the create or update ApplicationSecurityGroup operation. +// - options - ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate +// method. +func (client *ApplicationSecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationSecurityGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationSecurityGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationSecurityGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an application security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationSecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationSecurityGroupName == "" { + return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified application security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationSecurityGroupName - The name of the application security group. +// - options - ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete +// method. +func (client *ApplicationSecurityGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*runtime.Poller[ApplicationSecurityGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, applicationSecurityGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationSecurityGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApplicationSecurityGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified application security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationSecurityGroupName == "" { + return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified application security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationSecurityGroupName - The name of the application security group. +// - options - ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get +// method. +func (client *ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientGetOptions) (ApplicationSecurityGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, options) + if err != nil { + return ApplicationSecurityGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationSecurityGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationSecurityGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationSecurityGroupName == "" { + return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientGetResponse, error) { + result := ApplicationSecurityGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroup); err != nil { + return ApplicationSecurityGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the application security groups in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager +// method. +func (client *ApplicationSecurityGroupsClient) NewListPager(resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) *runtime.Pager[ApplicationSecurityGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationSecurityGroupsClientListResponse]{ + More: func(page ApplicationSecurityGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationSecurityGroupsClientListResponse) (ApplicationSecurityGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationSecurityGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationSecurityGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationSecurityGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientListResponse, error) { + result := ApplicationSecurityGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroupListResult); err != nil { + return ApplicationSecurityGroupsClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all application security groups in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager +// method. +func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationSecurityGroupsClientListAllResponse]{ + More: func(page ApplicationSecurityGroupsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationSecurityGroupsClientListAllResponse) (ApplicationSecurityGroupsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationSecurityGroupsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationSecurityGroupsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationSecurityGroupsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *ApplicationSecurityGroupsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *ApplicationSecurityGroupsClient) listAllHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientListAllResponse, error) { + result := ApplicationSecurityGroupsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroupListResult); err != nil { + return ApplicationSecurityGroupsClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates an application security group's tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - applicationSecurityGroupName - The name of the application security group. +// - parameters - Parameters supplied to update application security group tags. +// - options - ApplicationSecurityGroupsClientUpdateTagsOptions contains the optional parameters for the ApplicationSecurityGroupsClient.UpdateTags +// method. +func (client *ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject, options *ApplicationSecurityGroupsClientUpdateTagsOptions) (ApplicationSecurityGroupsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, applicationSecurityGroupName, parameters, options) + if err != nil { + return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationSecurityGroupsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject, options *ApplicationSecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if applicationSecurityGroupName == "" { + return nil, errors.New("parameter applicationSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationSecurityGroupName}", url.PathEscape(applicationSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ApplicationSecurityGroupsClient) updateTagsHandleResponse(resp *http.Response) (ApplicationSecurityGroupsClientUpdateTagsResponse, error) { + result := ApplicationSecurityGroupsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationSecurityGroup); err != nil { + return ApplicationSecurityGroupsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/assets.json new file mode 100644 index 00000000000..04dbda1a080 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "go", + "TagPrefix": "go/resourcemanager/network/armnetwork", + "Tag": "go/resourcemanager/network/armnetwork_98a17ae925" +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/autorest.md new file mode 100644 index 00000000000..d0e49fa0adc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/autorest.md @@ -0,0 +1,12 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- https://github.com/Azure/azure-rest-api-specs/blob/a60468a0c5e2beb054680ae488fb9f92699f0a0d/specification/network/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/a60468a0c5e2beb054680ae488fb9f92699f0a0d/specification/network/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 2.2.1 +``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availabledelegations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availabledelegations_client.go new file mode 100644 index 00000000000..dbecf99dfb3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availabledelegations_client.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AvailableDelegationsClient contains the methods for the AvailableDelegations group. +// Don't use this type directly, use NewAvailableDelegationsClient() instead. +type AvailableDelegationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAvailableDelegationsClient creates a new instance of AvailableDelegationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAvailableDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableDelegationsClient, error) { + cl, err := arm.NewClient(moduleName+".AvailableDelegationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AvailableDelegationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets all of the available subnet delegations for this subscription in this region. +// +// Generated from API version 2022-09-01 +// - location - The location of the subnet. +// - options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager +// method. +func (client *AvailableDelegationsClient) NewListPager(location string, options *AvailableDelegationsClientListOptions) *runtime.Pager[AvailableDelegationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailableDelegationsClientListResponse]{ + More: func(page AvailableDelegationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailableDelegationsClientListResponse) (AvailableDelegationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableDelegationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailableDelegationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableDelegationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, location string, options *AvailableDelegationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AvailableDelegationsClient) listHandleResponse(resp *http.Response) (AvailableDelegationsClientListResponse, error) { + result := AvailableDelegationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailableDelegationsResult); err != nil { + return AvailableDelegationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableendpointservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableendpointservices_client.go new file mode 100644 index 00000000000..b8bb8ef681a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableendpointservices_client.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AvailableEndpointServicesClient contains the methods for the AvailableEndpointServices group. +// Don't use this type directly, use NewAvailableEndpointServicesClient() instead. +type AvailableEndpointServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAvailableEndpointServicesClient creates a new instance of AvailableEndpointServicesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableEndpointServicesClient, error) { + cl, err := arm.NewClient(moduleName+".AvailableEndpointServicesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AvailableEndpointServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List what values of endpoint services are available for use. +// +// Generated from API version 2022-09-01 +// - location - The location to check available endpoint services. +// - options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager +// method. +func (client *AvailableEndpointServicesClient) NewListPager(location string, options *AvailableEndpointServicesClientListOptions) *runtime.Pager[AvailableEndpointServicesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailableEndpointServicesClientListResponse]{ + More: func(page AvailableEndpointServicesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailableEndpointServicesClientListResponse) (AvailableEndpointServicesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableEndpointServicesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailableEndpointServicesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableEndpointServicesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Context, location string, options *AvailableEndpointServicesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AvailableEndpointServicesClient) listHandleResponse(resp *http.Response) (AvailableEndpointServicesClientListResponse, error) { + result := AvailableEndpointServicesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EndpointServicesListResult); err != nil { + return AvailableEndpointServicesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableprivateendpointtypes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableprivateendpointtypes_client.go new file mode 100644 index 00000000000..b8cfc64fc13 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableprivateendpointtypes_client.go @@ -0,0 +1,183 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AvailablePrivateEndpointTypesClient contains the methods for the AvailablePrivateEndpointTypes group. +// Don't use this type directly, use NewAvailablePrivateEndpointTypesClient() instead. +type AvailablePrivateEndpointTypesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAvailablePrivateEndpointTypesClient creates a new instance of AvailablePrivateEndpointTypesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAvailablePrivateEndpointTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailablePrivateEndpointTypesClient, error) { + cl, err := arm.NewClient(moduleName+".AvailablePrivateEndpointTypesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AvailablePrivateEndpointTypesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this +// region. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager +// method. +func (client *AvailablePrivateEndpointTypesClient) NewListPager(location string, options *AvailablePrivateEndpointTypesClientListOptions) *runtime.Pager[AvailablePrivateEndpointTypesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailablePrivateEndpointTypesClientListResponse]{ + More: func(page AvailablePrivateEndpointTypesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailablePrivateEndpointTypesClientListResponse) (AvailablePrivateEndpointTypesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailablePrivateEndpointTypesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailablePrivateEndpointTypesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailablePrivateEndpointTypesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context.Context, location string, options *AvailablePrivateEndpointTypesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AvailablePrivateEndpointTypesClient) listHandleResponse(resp *http.Response) (AvailablePrivateEndpointTypesClientListResponse, error) { + result := AvailablePrivateEndpointTypesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailablePrivateEndpointTypesResult); err != nil { + return AvailablePrivateEndpointTypesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Returns all of the resource types that can be linked to a Private Endpoint in this subscription +// in this region. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - resourceGroupName - The name of the resource group. +// - options - AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager +// method. +func (client *AvailablePrivateEndpointTypesClient) NewListByResourceGroupPager(location string, resourceGroupName string, options *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) *runtime.Pager[AvailablePrivateEndpointTypesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailablePrivateEndpointTypesClientListByResourceGroupResponse]{ + More: func(page AvailablePrivateEndpointTypesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailablePrivateEndpointTypesClientListByResourceGroupResponse) (AvailablePrivateEndpointTypesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, location, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupHandleResponse(resp *http.Response) (AvailablePrivateEndpointTypesClientListByResourceGroupResponse, error) { + result := AvailablePrivateEndpointTypesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailablePrivateEndpointTypesResult); err != nil { + return AvailablePrivateEndpointTypesClientListByResourceGroupResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableresourcegroupdelegations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableresourcegroupdelegations_client.go new file mode 100644 index 00000000000..deed83f58ab --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableresourcegroupdelegations_client.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AvailableResourceGroupDelegationsClient contains the methods for the AvailableResourceGroupDelegations group. +// Don't use this type directly, use NewAvailableResourceGroupDelegationsClient() instead. +type AvailableResourceGroupDelegationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAvailableResourceGroupDelegationsClient creates a new instance of AvailableResourceGroupDelegationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableResourceGroupDelegationsClient, error) { + cl, err := arm.NewClient(moduleName+".AvailableResourceGroupDelegationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AvailableResourceGroupDelegationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets all of the available subnet delegations for this resource group in this region. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - resourceGroupName - The name of the resource group. +// - options - AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.NewListPager +// method. +func (client *AvailableResourceGroupDelegationsClient) NewListPager(location string, resourceGroupName string, options *AvailableResourceGroupDelegationsClientListOptions) *runtime.Pager[AvailableResourceGroupDelegationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailableResourceGroupDelegationsClientListResponse]{ + More: func(page AvailableResourceGroupDelegationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailableResourceGroupDelegationsClientListResponse) (AvailableResourceGroupDelegationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableResourceGroupDelegationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailableResourceGroupDelegationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableResourceGroupDelegationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailableResourceGroupDelegationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AvailableResourceGroupDelegationsClient) listHandleResponse(resp *http.Response) (AvailableResourceGroupDelegationsClientListResponse, error) { + result := AvailableResourceGroupDelegationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailableDelegationsResult); err != nil { + return AvailableResourceGroupDelegationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableservicealiases_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableservicealiases_client.go new file mode 100644 index 00000000000..0c7da64e984 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/availableservicealiases_client.go @@ -0,0 +1,181 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AvailableServiceAliasesClient contains the methods for the AvailableServiceAliases group. +// Don't use this type directly, use NewAvailableServiceAliasesClient() instead. +type AvailableServiceAliasesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAvailableServiceAliasesClient creates a new instance of AvailableServiceAliasesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableServiceAliasesClient, error) { + cl, err := arm.NewClient(moduleName+".AvailableServiceAliasesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AvailableServiceAliasesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets all available service aliases for this subscription in this region. +// +// Generated from API version 2022-09-01 +// - location - The location. +// - options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager +// method. +func (client *AvailableServiceAliasesClient) NewListPager(location string, options *AvailableServiceAliasesClientListOptions) *runtime.Pager[AvailableServiceAliasesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailableServiceAliasesClientListResponse]{ + More: func(page AvailableServiceAliasesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailableServiceAliasesClientListResponse) (AvailableServiceAliasesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableServiceAliasesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailableServiceAliasesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableServiceAliasesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Context, location string, options *AvailableServiceAliasesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AvailableServiceAliasesClient) listHandleResponse(resp *http.Response) (AvailableServiceAliasesClientListResponse, error) { + result := AvailableServiceAliasesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailableServiceAliasesResult); err != nil { + return AvailableServiceAliasesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all available service aliases for this resource group in this region. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - location - The location. +// - options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager +// method. +func (client *AvailableServiceAliasesClient) NewListByResourceGroupPager(resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) *runtime.Pager[AvailableServiceAliasesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[AvailableServiceAliasesClientListByResourceGroupResponse]{ + More: func(page AvailableServiceAliasesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AvailableServiceAliasesClientListByResourceGroupResponse) (AvailableServiceAliasesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableServiceAliasesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AvailableServiceAliasesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableServiceAliasesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AvailableServiceAliasesClient) listByResourceGroupHandleResponse(resp *http.Response) (AvailableServiceAliasesClientListByResourceGroupResponse, error) { + result := AvailableServiceAliasesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailableServiceAliasesResult); err != nil { + return AvailableServiceAliasesClientListByResourceGroupResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewallfqdntags_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewallfqdntags_client.go new file mode 100644 index 00000000000..cb7fa11f701 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewallfqdntags_client.go @@ -0,0 +1,106 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AzureFirewallFqdnTagsClient contains the methods for the AzureFirewallFqdnTags group. +// Don't use this type directly, use NewAzureFirewallFqdnTagsClient() instead. +type AzureFirewallFqdnTagsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAzureFirewallFqdnTagsClient creates a new instance of AzureFirewallFqdnTagsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallFqdnTagsClient, error) { + cl, err := arm.NewClient(moduleName+".AzureFirewallFqdnTagsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureFirewallFqdnTagsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListAllPager - Gets all the Azure Firewall FQDN Tags in a subscription. +// +// Generated from API version 2022-09-01 +// - options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager +// method. +func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureFirewallFqdnTagsClientListAllResponse]{ + More: func(page AzureFirewallFqdnTagsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureFirewallFqdnTagsClientListAllResponse) (AzureFirewallFqdnTagsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureFirewallFqdnTagsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureFirewallFqdnTagsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureFirewallFqdnTagsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallFqdnTagsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *AzureFirewallFqdnTagsClient) listAllHandleResponse(resp *http.Response) (AzureFirewallFqdnTagsClientListAllResponse, error) { + result := AzureFirewallFqdnTagsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallFqdnTagListResult); err != nil { + return AzureFirewallFqdnTagsClientListAllResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewalls_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewalls_client.go new file mode 100644 index 00000000000..533662773ad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/azurefirewalls_client.go @@ -0,0 +1,497 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// AzureFirewallsClient contains the methods for the AzureFirewalls group. +// Don't use this type directly, use NewAzureFirewallsClient() instead. +type AzureFirewallsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAzureFirewallsClient creates a new instance of AzureFirewallsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAzureFirewallsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureFirewallsClient, error) { + cl, err := arm.NewClient(moduleName+".AzureFirewallsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureFirewallsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Azure Firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - azureFirewallName - The name of the Azure Firewall. +// - parameters - Parameters supplied to the create or update Azure Firewall operation. +// - options - AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate +// method. +func (client *AzureFirewallsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureFirewallsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, azureFirewallName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AzureFirewallsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Azure Firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AzureFirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, azureFirewallName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if azureFirewallName == "" { + return nil, errors.New("parameter azureFirewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Azure Firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - azureFirewallName - The name of the Azure Firewall. +// - options - AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete +// method. +func (client *AzureFirewallsClient) BeginDelete(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*runtime.Poller[AzureFirewallsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, azureFirewallName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AzureFirewallsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Azure Firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, azureFirewallName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if azureFirewallName == "" { + return nil, errors.New("parameter azureFirewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Azure Firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - azureFirewallName - The name of the Azure Firewall. +// - options - AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. +func (client *AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientGetOptions) (AzureFirewallsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, azureFirewallName, options) + if err != nil { + return AzureFirewallsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureFirewallsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureFirewallsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if azureFirewallName == "" { + return nil, errors.New("parameter azureFirewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (AzureFirewallsClientGetResponse, error) { + result := AzureFirewallsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewall); err != nil { + return AzureFirewallsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all Azure Firewalls in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.NewListPager method. +func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, options *AzureFirewallsClientListOptions) *runtime.Pager[AzureFirewallsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureFirewallsClientListResponse]{ + More: func(page AzureFirewallsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureFirewallsClientListResponse) (AzureFirewallsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureFirewallsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureFirewallsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureFirewallsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AzureFirewallsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (AzureFirewallsClientListResponse, error) { + result := AzureFirewallsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallListResult); err != nil { + return AzureFirewallsClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the Azure Firewalls in a subscription. +// +// Generated from API version 2022-09-01 +// - options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager +// method. +func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureFirewallsClientListAllResponse]{ + More: func(page AzureFirewallsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureFirewallsClientListAllResponse) (AzureFirewallsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureFirewallsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureFirewallsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureFirewallsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *AzureFirewallsClient) listAllHandleResponse(resp *http.Response) (AzureFirewallsClientListAllResponse, error) { + result := AzureFirewallsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureFirewallListResult); err != nil { + return AzureFirewallsClientListAllResponse{}, err + } + return result, nil +} + +// BeginListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - azureFirewallName - The name of the azure firewall. +// - options - AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes +// method. +func (client *AzureFirewallsClient) BeginListLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*runtime.Poller[AzureFirewallsClientListLearnedPrefixesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listLearnedPrefixes(ctx, resourceGroupName, azureFirewallName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientListLearnedPrefixesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AzureFirewallsClientListLearnedPrefixesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListLearnedPrefixes - Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { + req, err := client.listLearnedPrefixesCreateRequest(ctx, resourceGroupName, azureFirewallName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listLearnedPrefixesCreateRequest creates the ListLearnedPrefixes request. +func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if azureFirewallName == "" { + return nil, errors.New("parameter azureFirewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdateTags - Updates tags of an Azure Firewall resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - azureFirewallName - The name of the Azure Firewall. +// - parameters - Parameters supplied to update azure firewall tags. +// - options - AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags +// method. +func (client *AzureFirewallsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*runtime.Poller[AzureFirewallsClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, azureFirewallName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureFirewallsClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AzureFirewallsClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates tags of an Azure Firewall resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *AzureFirewallsClient) updateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, azureFirewallName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject, options *AzureFirewallsClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if azureFirewallName == "" { + return nil, errors.New("parameter azureFirewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{azureFirewallName}", url.PathEscape(azureFirewallName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bastionhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bastionhosts_client.go new file mode 100644 index 00000000000..2fba66d646a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bastionhosts_client.go @@ -0,0 +1,430 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// BastionHostsClient contains the methods for the BastionHosts group. +// Don't use this type directly, use NewBastionHostsClient() instead. +type BastionHostsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewBastionHostsClient creates a new instance of BastionHostsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewBastionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BastionHostsClient, error) { + cl, err := arm.NewClient(moduleName+".BastionHostsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &BastionHostsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Bastion Host. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - parameters - Parameters supplied to the create or update Bastion Host operation. +// - options - BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate +// method. +func (client *BastionHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BastionHostsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, bastionHostName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[BastionHostsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Bastion Host. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *BastionHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, bastionHostName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost, options *BastionHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Bastion Host. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete +// method. +func (client *BastionHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*runtime.Poller[BastionHostsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, bastionHostName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[BastionHostsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Bastion Host. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, bastionHostName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Bastion Host. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. +func (client *BastionHostsClient) Get(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientGetOptions) (BastionHostsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, bastionHostName, options) + if err != nil { + return BastionHostsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BastionHostsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (BastionHostsClientGetResponse, error) { + result := BastionHostsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHost); err != nil { + return BastionHostsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all Bastion Hosts in a subscription. +// +// Generated from API version 2022-09-01 +// - options - BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.NewListPager method. +func (client *BastionHostsClient) NewListPager(options *BastionHostsClientListOptions) *runtime.Pager[BastionHostsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListResponse]{ + More: func(page BastionHostsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BastionHostsClientListResponse) (BastionHostsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BastionHostsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BastionHostsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options *BastionHostsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (BastionHostsClientListResponse, error) { + result := BastionHostsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHostListResult); err != nil { + return BastionHostsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager +// method. +func (client *BastionHostsClient) NewListByResourceGroupPager(resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) *runtime.Pager[BastionHostsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[BastionHostsClientListByResourceGroupResponse]{ + More: func(page BastionHostsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BastionHostsClientListByResourceGroupResponse) (BastionHostsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BastionHostsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BastionHostsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BastionHostsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *BastionHostsClient) listByResourceGroupHandleResponse(resp *http.Response) (BastionHostsClientListByResourceGroupResponse, error) { + result := BastionHostsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionHostListResult); err != nil { + return BastionHostsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// BeginUpdateTags - Updates Tags for BastionHost resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - parameters - Parameters supplied to update BastionHost tags. +// - options - BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags +// method. +func (client *BastionHostsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*runtime.Poller[BastionHostsClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, bastionHostName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BastionHostsClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[BastionHostsClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates Tags for BastionHost resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *BastionHostsClient) updateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, bastionHostName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}" + 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 bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bgpservicecommunities_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bgpservicecommunities_client.go new file mode 100644 index 00000000000..1c7044126e1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/bgpservicecommunities_client.go @@ -0,0 +1,106 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// BgpServiceCommunitiesClient contains the methods for the BgpServiceCommunities group. +// Don't use this type directly, use NewBgpServiceCommunitiesClient() instead. +type BgpServiceCommunitiesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewBgpServiceCommunitiesClient creates a new instance of BgpServiceCommunitiesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BgpServiceCommunitiesClient, error) { + cl, err := arm.NewClient(moduleName+".BgpServiceCommunitiesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &BgpServiceCommunitiesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets all the available bgp service communities. +// +// Generated from API version 2022-09-01 +// - options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager +// method. +func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BgpServiceCommunitiesClientListResponse]{ + More: func(page BgpServiceCommunitiesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BgpServiceCommunitiesClientListResponse) (BgpServiceCommunitiesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BgpServiceCommunitiesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BgpServiceCommunitiesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BgpServiceCommunitiesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context, options *BgpServiceCommunitiesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BgpServiceCommunitiesClient) listHandleResponse(resp *http.Response) (BgpServiceCommunitiesClientListResponse, error) { + result := BgpServiceCommunitiesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BgpServiceCommunityListResult); err != nil { + return BgpServiceCommunitiesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/build.go new file mode 100644 index 00000000000..a2225010025 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/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/network/armnetwork + +package armnetwork diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ci.yml new file mode 100644 index 00000000000..d1d36edcadb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/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/network/armnetwork/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/network/armnetwork/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/network/armnetwork' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/client_factory.go new file mode 100644 index 00000000000..497fca222fe --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/client_factory.go @@ -0,0 +1,700 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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 + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// 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 subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - 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) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewApplicationGatewaysClient() *ApplicationGatewaysClient { + subClient, _ := NewApplicationGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationGatewayPrivateLinkResourcesClient() *ApplicationGatewayPrivateLinkResourcesClient { + subClient, _ := NewApplicationGatewayPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationGatewayPrivateEndpointConnectionsClient() *ApplicationGatewayPrivateEndpointConnectionsClient { + subClient, _ := NewApplicationGatewayPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationGatewayWafDynamicManifestsDefaultClient() *ApplicationGatewayWafDynamicManifestsDefaultClient { + subClient, _ := NewApplicationGatewayWafDynamicManifestsDefaultClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationGatewayWafDynamicManifestsClient() *ApplicationGatewayWafDynamicManifestsClient { + subClient, _ := NewApplicationGatewayWafDynamicManifestsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationSecurityGroupsClient() *ApplicationSecurityGroupsClient { + subClient, _ := NewApplicationSecurityGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAvailableDelegationsClient() *AvailableDelegationsClient { + subClient, _ := NewAvailableDelegationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAvailableResourceGroupDelegationsClient() *AvailableResourceGroupDelegationsClient { + subClient, _ := NewAvailableResourceGroupDelegationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAvailableServiceAliasesClient() *AvailableServiceAliasesClient { + subClient, _ := NewAvailableServiceAliasesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAzureFirewallsClient() *AzureFirewallsClient { + subClient, _ := NewAzureFirewallsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAzureFirewallFqdnTagsClient() *AzureFirewallFqdnTagsClient { + subClient, _ := NewAzureFirewallFqdnTagsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewWebCategoriesClient() *WebCategoriesClient { + subClient, _ := NewWebCategoriesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewBastionHostsClient() *BastionHostsClient { + subClient, _ := NewBastionHostsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagementClient() *ManagementClient { + subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInterfacesClient() *InterfacesClient { + subClient, _ := NewInterfacesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPublicIPAddressesClient() *PublicIPAddressesClient { + subClient, _ := NewPublicIPAddressesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVipSwapClient() *VipSwapClient { + subClient, _ := NewVipSwapClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCustomIPPrefixesClient() *CustomIPPrefixesClient { + subClient, _ := NewCustomIPPrefixesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDdosCustomPoliciesClient() *DdosCustomPoliciesClient { + subClient, _ := NewDdosCustomPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDdosProtectionPlansClient() *DdosProtectionPlansClient { + subClient, _ := NewDdosProtectionPlansClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDscpConfigurationClient() *DscpConfigurationClient { + subClient, _ := NewDscpConfigurationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAvailableEndpointServicesClient() *AvailableEndpointServicesClient { + subClient, _ := NewAvailableEndpointServicesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCircuitAuthorizationsClient() *ExpressRouteCircuitAuthorizationsClient { + subClient, _ := NewExpressRouteCircuitAuthorizationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCircuitPeeringsClient() *ExpressRouteCircuitPeeringsClient { + subClient, _ := NewExpressRouteCircuitPeeringsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCircuitConnectionsClient() *ExpressRouteCircuitConnectionsClient { + subClient, _ := NewExpressRouteCircuitConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPeerExpressRouteCircuitConnectionsClient() *PeerExpressRouteCircuitConnectionsClient { + subClient, _ := NewPeerExpressRouteCircuitConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCircuitsClient() *ExpressRouteCircuitsClient { + subClient, _ := NewExpressRouteCircuitsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteServiceProvidersClient() *ExpressRouteServiceProvidersClient { + subClient, _ := NewExpressRouteServiceProvidersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCrossConnectionsClient() *ExpressRouteCrossConnectionsClient { + subClient, _ := NewExpressRouteCrossConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteCrossConnectionPeeringsClient() *ExpressRouteCrossConnectionPeeringsClient { + subClient, _ := NewExpressRouteCrossConnectionPeeringsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRoutePortsLocationsClient() *ExpressRoutePortsLocationsClient { + subClient, _ := NewExpressRoutePortsLocationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRoutePortsClient() *ExpressRoutePortsClient { + subClient, _ := NewExpressRoutePortsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteLinksClient() *ExpressRouteLinksClient { + subClient, _ := NewExpressRouteLinksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRoutePortAuthorizationsClient() *ExpressRoutePortAuthorizationsClient { + subClient, _ := NewExpressRoutePortAuthorizationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteProviderPortsLocationClient() *ExpressRouteProviderPortsLocationClient { + subClient, _ := NewExpressRouteProviderPortsLocationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallPoliciesClient() *FirewallPoliciesClient { + subClient, _ := NewFirewallPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallPolicyRuleCollectionGroupsClient() *FirewallPolicyRuleCollectionGroupsClient { + subClient, _ := NewFirewallPolicyRuleCollectionGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallPolicyIdpsSignaturesClient() *FirewallPolicyIdpsSignaturesClient { + subClient, _ := NewFirewallPolicyIdpsSignaturesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallPolicyIdpsSignaturesOverridesClient() *FirewallPolicyIdpsSignaturesOverridesClient { + subClient, _ := NewFirewallPolicyIdpsSignaturesOverridesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallPolicyIdpsSignaturesFilterValuesClient() *FirewallPolicyIdpsSignaturesFilterValuesClient { + subClient, _ := NewFirewallPolicyIdpsSignaturesFilterValuesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewIPAllocationsClient() *IPAllocationsClient { + subClient, _ := NewIPAllocationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewIPGroupsClient() *IPGroupsClient { + subClient, _ := NewIPGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancersClient() *LoadBalancersClient { + subClient, _ := NewLoadBalancersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerBackendAddressPoolsClient() *LoadBalancerBackendAddressPoolsClient { + subClient, _ := NewLoadBalancerBackendAddressPoolsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerFrontendIPConfigurationsClient() *LoadBalancerFrontendIPConfigurationsClient { + subClient, _ := NewLoadBalancerFrontendIPConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInboundNatRulesClient() *InboundNatRulesClient { + subClient, _ := NewInboundNatRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerLoadBalancingRulesClient() *LoadBalancerLoadBalancingRulesClient { + subClient, _ := NewLoadBalancerLoadBalancingRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerOutboundRulesClient() *LoadBalancerOutboundRulesClient { + subClient, _ := NewLoadBalancerOutboundRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerNetworkInterfacesClient() *LoadBalancerNetworkInterfacesClient { + subClient, _ := NewLoadBalancerNetworkInterfacesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLoadBalancerProbesClient() *LoadBalancerProbesClient { + subClient, _ := NewLoadBalancerProbesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewNatGatewaysClient() *NatGatewaysClient { + subClient, _ := NewNatGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInterfaceIPConfigurationsClient() *InterfaceIPConfigurationsClient { + subClient, _ := NewInterfaceIPConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInterfaceLoadBalancersClient() *InterfaceLoadBalancersClient { + subClient, _ := NewInterfaceLoadBalancersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInterfaceTapConfigurationsClient() *InterfaceTapConfigurationsClient { + subClient, _ := NewInterfaceTapConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagersClient() *ManagersClient { + subClient, _ := NewManagersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagerCommitsClient() *ManagerCommitsClient { + subClient, _ := NewManagerCommitsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagerDeploymentStatusClient() *ManagerDeploymentStatusClient { + subClient, _ := NewManagerDeploymentStatusClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSubscriptionNetworkManagerConnectionsClient() *SubscriptionNetworkManagerConnectionsClient { + subClient, _ := NewSubscriptionNetworkManagerConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewManagementGroupNetworkManagerConnectionsClient() *ManagementGroupNetworkManagerConnectionsClient { + subClient, _ := NewManagementGroupNetworkManagerConnectionsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConnectivityConfigurationsClient() *ConnectivityConfigurationsClient { + subClient, _ := NewConnectivityConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewGroupsClient() *GroupsClient { + subClient, _ := NewGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewStaticMembersClient() *StaticMembersClient { + subClient, _ := NewStaticMembersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewScopeConnectionsClient() *ScopeConnectionsClient { + subClient, _ := NewScopeConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecurityAdminConfigurationsClient() *SecurityAdminConfigurationsClient { + subClient, _ := NewSecurityAdminConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAdminRuleCollectionsClient() *AdminRuleCollectionsClient { + subClient, _ := NewAdminRuleCollectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAdminRulesClient() *AdminRulesClient { + subClient, _ := NewAdminRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewProfilesClient() *ProfilesClient { + subClient, _ := NewProfilesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecurityGroupsClient() *SecurityGroupsClient { + subClient, _ := NewSecurityGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecurityRulesClient() *SecurityRulesClient { + subClient, _ := NewSecurityRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDefaultSecurityRulesClient() *DefaultSecurityRulesClient { + subClient, _ := NewDefaultSecurityRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualAppliancesClient() *VirtualAppliancesClient { + subClient, _ := NewVirtualAppliancesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualApplianceSitesClient() *VirtualApplianceSitesClient { + subClient, _ := NewVirtualApplianceSitesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualApplianceSKUsClient() *VirtualApplianceSKUsClient { + subClient, _ := NewVirtualApplianceSKUsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInboundSecurityRuleClient() *InboundSecurityRuleClient { + subClient, _ := NewInboundSecurityRuleClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewWatchersClient() *WatchersClient { + subClient, _ := NewWatchersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPacketCapturesClient() *PacketCapturesClient { + subClient, _ := NewPacketCapturesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConnectionMonitorsClient() *ConnectionMonitorsClient { + subClient, _ := NewConnectionMonitorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFlowLogsClient() *FlowLogsClient { + subClient, _ := NewFlowLogsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrivateEndpointsClient() *PrivateEndpointsClient { + subClient, _ := NewPrivateEndpointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAvailablePrivateEndpointTypesClient() *AvailablePrivateEndpointTypesClient { + subClient, _ := NewAvailablePrivateEndpointTypesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrivateDNSZoneGroupsClient() *PrivateDNSZoneGroupsClient { + subClient, _ := NewPrivateDNSZoneGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrivateLinkServicesClient() *PrivateLinkServicesClient { + subClient, _ := NewPrivateLinkServicesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPublicIPPrefixesClient() *PublicIPPrefixesClient { + subClient, _ := NewPublicIPPrefixesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRouteFiltersClient() *RouteFiltersClient { + subClient, _ := NewRouteFiltersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRouteFilterRulesClient() *RouteFilterRulesClient { + subClient, _ := NewRouteFilterRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRouteTablesClient() *RouteTablesClient { + subClient, _ := NewRouteTablesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRoutesClient() *RoutesClient { + subClient, _ := NewRoutesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecurityPartnerProvidersClient() *SecurityPartnerProvidersClient { + subClient, _ := NewSecurityPartnerProvidersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewBgpServiceCommunitiesClient() *BgpServiceCommunitiesClient { + subClient, _ := NewBgpServiceCommunitiesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServiceEndpointPoliciesClient() *ServiceEndpointPoliciesClient { + subClient, _ := NewServiceEndpointPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServiceEndpointPolicyDefinitionsClient() *ServiceEndpointPolicyDefinitionsClient { + subClient, _ := NewServiceEndpointPolicyDefinitionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServiceTagsClient() *ServiceTagsClient { + subClient, _ := NewServiceTagsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServiceTagInformationClient() *ServiceTagInformationClient { + subClient, _ := NewServiceTagInformationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewUsagesClient() *UsagesClient { + subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworksClient() *VirtualNetworksClient { + subClient, _ := NewVirtualNetworksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSubnetsClient() *SubnetsClient { + subClient, _ := NewSubnetsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewResourceNavigationLinksClient() *ResourceNavigationLinksClient { + subClient, _ := NewResourceNavigationLinksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServiceAssociationLinksClient() *ServiceAssociationLinksClient { + subClient, _ := NewServiceAssociationLinksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworkPeeringsClient() *VirtualNetworkPeeringsClient { + subClient, _ := NewVirtualNetworkPeeringsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworkGatewaysClient() *VirtualNetworkGatewaysClient { + subClient, _ := NewVirtualNetworkGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworkGatewayConnectionsClient() *VirtualNetworkGatewayConnectionsClient { + subClient, _ := NewVirtualNetworkGatewayConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLocalNetworkGatewaysClient() *LocalNetworkGatewaysClient { + subClient, _ := NewLocalNetworkGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworkGatewayNatRulesClient() *VirtualNetworkGatewayNatRulesClient { + subClient, _ := NewVirtualNetworkGatewayNatRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualNetworkTapsClient() *VirtualNetworkTapsClient { + subClient, _ := NewVirtualNetworkTapsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualRoutersClient() *VirtualRoutersClient { + subClient, _ := NewVirtualRoutersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualRouterPeeringsClient() *VirtualRouterPeeringsClient { + subClient, _ := NewVirtualRouterPeeringsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualWansClient() *VirtualWansClient { + subClient, _ := NewVirtualWansClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNSitesClient() *VPNSitesClient { + subClient, _ := NewVPNSitesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNSiteLinksClient() *VPNSiteLinksClient { + subClient, _ := NewVPNSiteLinksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNSitesConfigurationClient() *VPNSitesConfigurationClient { + subClient, _ := NewVPNSitesConfigurationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNServerConfigurationsClient() *VPNServerConfigurationsClient { + subClient, _ := NewVPNServerConfigurationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConfigurationPolicyGroupsClient() *ConfigurationPolicyGroupsClient { + subClient, _ := NewConfigurationPolicyGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualHubsClient() *VirtualHubsClient { + subClient, _ := NewVirtualHubsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRouteMapsClient() *RouteMapsClient { + subClient, _ := NewRouteMapsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewHubVirtualNetworkConnectionsClient() *HubVirtualNetworkConnectionsClient { + subClient, _ := NewHubVirtualNetworkConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNGatewaysClient() *VPNGatewaysClient { + subClient, _ := NewVPNGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNLinkConnectionsClient() *VPNLinkConnectionsClient { + subClient, _ := NewVPNLinkConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNConnectionsClient() *VPNConnectionsClient { + subClient, _ := NewVPNConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNSiteLinkConnectionsClient() *VPNSiteLinkConnectionsClient { + subClient, _ := NewVPNSiteLinkConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewNatRulesClient() *NatRulesClient { + subClient, _ := NewNatRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewP2SVPNGatewaysClient() *P2SVPNGatewaysClient { + subClient, _ := NewP2SVPNGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVPNServerConfigurationsAssociatedWithVirtualWanClient() *VPNServerConfigurationsAssociatedWithVirtualWanClient { + subClient, _ := NewVPNServerConfigurationsAssociatedWithVirtualWanClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualHubRouteTableV2SClient() *VirtualHubRouteTableV2SClient { + subClient, _ := NewVirtualHubRouteTableV2SClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteGatewaysClient() *ExpressRouteGatewaysClient { + subClient, _ := NewExpressRouteGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExpressRouteConnectionsClient() *ExpressRouteConnectionsClient { + subClient, _ := NewExpressRouteConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualHubBgpConnectionClient() *VirtualHubBgpConnectionClient { + subClient, _ := NewVirtualHubBgpConnectionClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualHubBgpConnectionsClient() *VirtualHubBgpConnectionsClient { + subClient, _ := NewVirtualHubBgpConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualHubIPConfigurationClient() *VirtualHubIPConfigurationClient { + subClient, _ := NewVirtualHubIPConfigurationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewHubRouteTablesClient() *HubRouteTablesClient { + subClient, _ := NewHubRouteTablesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRoutingIntentClient() *RoutingIntentClient { + subClient, _ := NewRoutingIntentClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewWebApplicationFirewallPoliciesClient() *WebApplicationFirewallPoliciesClient { + subClient, _ := NewWebApplicationFirewallPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/configurationpolicygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/configurationpolicygroups_client.go new file mode 100644 index 00000000000..afdd1c7d617 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/configurationpolicygroups_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ConfigurationPolicyGroupsClient contains the methods for the ConfigurationPolicyGroups group. +// Don't use this type directly, use NewConfigurationPolicyGroupsClient() instead. +type ConfigurationPolicyGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConfigurationPolicyGroupsClient creates a new instance of ConfigurationPolicyGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewConfigurationPolicyGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationPolicyGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".ConfigurationPolicyGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConfigurationPolicyGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. +// - vpnServerConfigurationPolicyGroupParameters - Parameters supplied to create or update a VpnServerConfiguration PolicyGroup. +// - options - ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate +// method. +func (client *ConfigurationPolicyGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConfigurationPolicyGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ConfigurationPolicyGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConfigurationPolicyGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + if configurationPolicyGroupName == "" { + return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters) +} + +// BeginDelete - Deletes a ConfigurationPolicyGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. +// - options - ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete +// method. +func (client *ConfigurationPolicyGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*runtime.Poller[ConfigurationPolicyGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationPolicyGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConfigurationPolicyGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a ConfigurationPolicyGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConfigurationPolicyGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + if configurationPolicyGroupName == "" { + return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a ConfigurationPolicyGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. +// - options - ConfigurationPolicyGroupsClientGetOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.Get +// method. +func (client *ConfigurationPolicyGroupsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (ConfigurationPolicyGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, options) + if err != nil { + return ConfigurationPolicyGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationPolicyGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationPolicyGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + if configurationPolicyGroupName == "" { + return nil, errors.New("parameter configurationPolicyGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationPolicyGroupName}", url.PathEscape(configurationPolicyGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Response) (ConfigurationPolicyGroupsClientGetResponse, error) { + result := ConfigurationPolicyGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfigurationPolicyGroup); err != nil { + return ConfigurationPolicyGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration. +// - options - ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager +// method. +func (client *ConfigurationPolicyGroupsClient) NewListByVPNServerConfigurationPager(resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) *runtime.Pager[ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse] { + return runtime.NewPager(runtime.PagingHandler[ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse]{ + More: func(page ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse) (ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVPNServerConfigurationCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, runtime.NewResponseError(resp) + } + return client.listByVPNServerConfigurationHandleResponse(resp) + }, + }) +} + +// listByVPNServerConfigurationCreateRequest creates the ListByVPNServerConfiguration request. +func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVPNServerConfigurationHandleResponse handles the ListByVPNServerConfiguration response. +func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationHandleResponse(resp *http.Response) (ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse, error) { + result := ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationPolicyGroupsResult); err != nil { + return ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectionmonitors_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectionmonitors_client.go new file mode 100644 index 00000000000..fabf621b020 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectionmonitors_client.go @@ -0,0 +1,600 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ConnectionMonitorsClient contains the methods for the ConnectionMonitors group. +// Don't use this type directly, use NewConnectionMonitorsClient() instead. +type ConnectionMonitorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConnectionMonitorsClient creates a new instance of ConnectionMonitorsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewConnectionMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectionMonitorsClient, error) { + cl, err := arm.NewClient(moduleName+".ConnectionMonitorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConnectionMonitorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name of the connection monitor. +// - parameters - Parameters that define the operation to create a connection monitor. +// - options - ConnectionMonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorsClient.BeginCreateOrUpdate +// method. +func (client *ConnectionMonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConnectionMonitorsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update a connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectionMonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, options *ConnectionMonitorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + if options != nil && options.Migrate != nil { + reqQP.Set("migrate", *options.Migrate) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name of the connection monitor. +// - options - ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete +// method. +func (client *ConnectionMonitorsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*runtime.Poller[ConnectionMonitorsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectionMonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a connection monitor by name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name of the connection monitor. +// - options - ConnectionMonitorsClientGetOptions contains the optional parameters for the ConnectionMonitorsClient.Get method. +func (client *ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientGetOptions) (ConnectionMonitorsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return ConnectionMonitorsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectionMonitorsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectionMonitorsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) (ConnectionMonitorsClientGetResponse, error) { + result := ConnectionMonitorsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorResult); err != nil { + return ConnectionMonitorsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all connection monitors for the specified Network Watcher. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - options - ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.NewListPager +// method. +func (client *ConnectionMonitorsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) *runtime.Pager[ConnectionMonitorsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConnectionMonitorsClientListResponse]{ + More: func(page ConnectionMonitorsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *ConnectionMonitorsClientListResponse) (ConnectionMonitorsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + if err != nil { + return ConnectionMonitorsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectionMonitorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectionMonitorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConnectionMonitorsClient) listHandleResponse(resp *http.Response) (ConnectionMonitorsClientListResponse, error) { + result := ConnectionMonitorsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorListResult); err != nil { + return ConnectionMonitorsClientListResponse{}, err + } + return result, nil +} + +// BeginQuery - Query a snapshot of the most recent connection states. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name given to the connection monitor. +// - options - ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery +// method. +func (client *ConnectionMonitorsClient) BeginQuery(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*runtime.Poller[ConnectionMonitorsClientQueryResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.query(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientQueryResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientQueryResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Query - Query a snapshot of the most recent connection states. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectionMonitorsClient) query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*http.Response, error) { + req, err := client.queryCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// queryCreateRequest creates the Query request. +func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStart - Starts the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name of the connection monitor. +// - options - ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart +// method. +func (client *ConnectionMonitorsClient) BeginStart(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*runtime.Poller[ConnectionMonitorsClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Start - Starts the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectionMonitorsClient) start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Stops the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - connectionMonitorName - The name of the connection monitor. +// - options - ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop +// method. +func (client *ConnectionMonitorsClient) BeginStop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*runtime.Poller[ConnectionMonitorsClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectionMonitorsClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Stop - Stops the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectionMonitorsClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// UpdateTags - Update tags of the specified connection monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - connectionMonitorName - The name of the connection monitor. +// - parameters - Parameters supplied to update connection monitor tags. +// - options - ConnectionMonitorsClientUpdateTagsOptions contains the optional parameters for the ConnectionMonitorsClient.UpdateTags +// method. +func (client *ConnectionMonitorsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject, options *ConnectionMonitorsClientUpdateTagsOptions) (ConnectionMonitorsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) + if err != nil { + return ConnectionMonitorsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectionMonitorsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectionMonitorsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject, options *ConnectionMonitorsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if connectionMonitorName == "" { + return nil, errors.New("parameter connectionMonitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionMonitorName}", url.PathEscape(connectionMonitorName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ConnectionMonitorsClient) updateTagsHandleResponse(resp *http.Response) (ConnectionMonitorsClientUpdateTagsResponse, error) { + result := ConnectionMonitorsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionMonitorResult); err != nil { + return ConnectionMonitorsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectivityconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectivityconfigurations_client.go new file mode 100644 index 00000000000..94c27959024 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/connectivityconfigurations_client.go @@ -0,0 +1,328 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ConnectivityConfigurationsClient contains the methods for the ConnectivityConfigurations group. +// Don't use this type directly, use NewConnectivityConfigurationsClient() instead. +type ConnectivityConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConnectivityConfigurationsClient creates a new instance of ConnectivityConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewConnectivityConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectivityConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".ConnectivityConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConnectivityConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates/Updates a new network manager connectivity configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager connectivity configuration. +// - connectivityConfiguration - Parameters supplied to create/update a network manager connectivity configuration +// - options - ConnectivityConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConnectivityConfigurationsClient.CreateOrUpdate +// method. +func (client *ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, options *ConnectivityConfigurationsClientCreateOrUpdateOptions) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, connectivityConfiguration, options) + if err != nil { + return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, options *ConnectivityConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, connectivityConfiguration) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ConnectivityConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientCreateOrUpdateResponse, error) { + result := ConnectivityConfigurationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfiguration); err != nil { + return ConnectivityConfigurationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, +// and connectivity configuration name +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager connectivity configuration. +// - options - ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete +// method. +func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*runtime.Poller[ConnectivityConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectivityConfigurationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ConnectivityConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and +// connectivity configuration name +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ConnectivityConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and connectivity +// Configuration name +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager connectivity configuration. +// - options - ConnectivityConfigurationsClientGetOptions contains the optional parameters for the ConnectivityConfigurationsClient.Get +// method. +func (client *ConnectivityConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientGetOptions) (ConnectivityConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return ConnectivityConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectivityConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectivityConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ConnectivityConfigurationsClient) getHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientGetResponse, error) { + result := ConnectivityConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfiguration); err != nil { + return ConnectivityConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the network manager connectivity configuration in a specified network manager. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.NewListPager +// method. +func (client *ConnectivityConfigurationsClient) NewListPager(resourceGroupName string, networkManagerName string, options *ConnectivityConfigurationsClientListOptions) *runtime.Pager[ConnectivityConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConnectivityConfigurationsClientListResponse]{ + More: func(page ConnectivityConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConnectivityConfigurationsClientListResponse) (ConnectivityConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConnectivityConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectivityConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectivityConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ConnectivityConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ConnectivityConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConnectivityConfigurationsClient) listHandleResponse(resp *http.Response) (ConnectivityConfigurationsClientListResponse, error) { + result := ConnectivityConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectivityConfigurationListResult); err != nil { + return ConnectivityConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/constants.go new file mode 100644 index 00000000000..74ebc60f5c7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/constants.go @@ -0,0 +1,3985 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +const ( + moduleName = "armnetwork" + moduleVersion = "v2.2.1" +) + +// Access - Access to be allowed or denied. +type Access string + +const ( + AccessAllow Access = "Allow" + AccessDeny Access = "Deny" +) + +// PossibleAccessValues returns the possible values for the Access const type. +func PossibleAccessValues() []Access { + return []Access{ + AccessAllow, + AccessDeny, + } +} + +// ActionType - Defines the action to take on rule match. +type ActionType string + +const ( + ActionTypeAllow ActionType = "Allow" + ActionTypeAnomalyScoring ActionType = "AnomalyScoring" + ActionTypeBlock ActionType = "Block" + ActionTypeLog ActionType = "Log" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeAllow, + ActionTypeAnomalyScoring, + ActionTypeBlock, + ActionTypeLog, + } +} + +// AddressPrefixType - Address prefix type. +type AddressPrefixType string + +const ( + AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" + AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" +) + +// PossibleAddressPrefixTypeValues returns the possible values for the AddressPrefixType const type. +func PossibleAddressPrefixTypeValues() []AddressPrefixType { + return []AddressPrefixType{ + AddressPrefixTypeIPPrefix, + AddressPrefixTypeServiceTag, + } +} + +// AdminRuleKind - Whether the rule is custom or default. +type AdminRuleKind string + +const ( + AdminRuleKindCustom AdminRuleKind = "Custom" + AdminRuleKindDefault AdminRuleKind = "Default" +) + +// PossibleAdminRuleKindValues returns the possible values for the AdminRuleKind const type. +func PossibleAdminRuleKindValues() []AdminRuleKind { + return []AdminRuleKind{ + AdminRuleKindCustom, + AdminRuleKindDefault, + } +} + +// ApplicationGatewayBackendHealthServerHealth - Health of backend server. +type ApplicationGatewayBackendHealthServerHealth string + +const ( + ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" + ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" + ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" + ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" +) + +// PossibleApplicationGatewayBackendHealthServerHealthValues returns the possible values for the ApplicationGatewayBackendHealthServerHealth const type. +func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { + return []ApplicationGatewayBackendHealthServerHealth{ + ApplicationGatewayBackendHealthServerHealthDown, + ApplicationGatewayBackendHealthServerHealthDraining, + ApplicationGatewayBackendHealthServerHealthPartial, + ApplicationGatewayBackendHealthServerHealthUnknown, + ApplicationGatewayBackendHealthServerHealthUp, + } +} + +// ApplicationGatewayClientRevocationOptions - Verify client certificate revocation status. +type ApplicationGatewayClientRevocationOptions string + +const ( + ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" + ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" +) + +// PossibleApplicationGatewayClientRevocationOptionsValues returns the possible values for the ApplicationGatewayClientRevocationOptions const type. +func PossibleApplicationGatewayClientRevocationOptionsValues() []ApplicationGatewayClientRevocationOptions { + return []ApplicationGatewayClientRevocationOptions{ + ApplicationGatewayClientRevocationOptionsNone, + ApplicationGatewayClientRevocationOptionsOCSP, + } +} + +// ApplicationGatewayCookieBasedAffinity - Cookie based affinity. +type ApplicationGatewayCookieBasedAffinity string + +const ( + ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" + ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" +) + +// PossibleApplicationGatewayCookieBasedAffinityValues returns the possible values for the ApplicationGatewayCookieBasedAffinity const type. +func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { + return []ApplicationGatewayCookieBasedAffinity{ + ApplicationGatewayCookieBasedAffinityDisabled, + ApplicationGatewayCookieBasedAffinityEnabled, + } +} + +// ApplicationGatewayCustomErrorStatusCode - Status code of the application gateway custom error. +type ApplicationGatewayCustomErrorStatusCode string + +const ( + ApplicationGatewayCustomErrorStatusCodeHTTPStatus400 ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus404 ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus405 ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus408 ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus499 ApplicationGatewayCustomErrorStatusCode = "HttpStatus499" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus500 ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus503 ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" + ApplicationGatewayCustomErrorStatusCodeHTTPStatus504 ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" +) + +// PossibleApplicationGatewayCustomErrorStatusCodeValues returns the possible values for the ApplicationGatewayCustomErrorStatusCode const type. +func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { + return []ApplicationGatewayCustomErrorStatusCode{ + ApplicationGatewayCustomErrorStatusCodeHTTPStatus400, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus403, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus404, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus405, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus408, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus499, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus500, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus502, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus503, + ApplicationGatewayCustomErrorStatusCodeHTTPStatus504, + } +} + +// ApplicationGatewayFirewallMode - Web application firewall mode. +type ApplicationGatewayFirewallMode string + +const ( + ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" +) + +// PossibleApplicationGatewayFirewallModeValues returns the possible values for the ApplicationGatewayFirewallMode const type. +func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { + return []ApplicationGatewayFirewallMode{ + ApplicationGatewayFirewallModeDetection, + ApplicationGatewayFirewallModePrevention, + } +} + +// ApplicationGatewayLoadDistributionAlgorithm - Load Distribution Algorithm enums. +type ApplicationGatewayLoadDistributionAlgorithm string + +const ( + ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" + ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" +) + +// PossibleApplicationGatewayLoadDistributionAlgorithmValues returns the possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. +func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGatewayLoadDistributionAlgorithm { + return []ApplicationGatewayLoadDistributionAlgorithm{ + ApplicationGatewayLoadDistributionAlgorithmIPHash, + ApplicationGatewayLoadDistributionAlgorithmLeastConnections, + ApplicationGatewayLoadDistributionAlgorithmRoundRobin, + } +} + +// ApplicationGatewayOperationalState - Operational state of the application gateway resource. +type ApplicationGatewayOperationalState string + +const ( + ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" + ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" +) + +// PossibleApplicationGatewayOperationalStateValues returns the possible values for the ApplicationGatewayOperationalState const type. +func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { + return []ApplicationGatewayOperationalState{ + ApplicationGatewayOperationalStateRunning, + ApplicationGatewayOperationalStateStarting, + ApplicationGatewayOperationalStateStopped, + ApplicationGatewayOperationalStateStopping, + } +} + +// ApplicationGatewayProtocol - Application Gateway protocol. +type ApplicationGatewayProtocol string + +const ( + ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" + ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" + ApplicationGatewayProtocolTCP ApplicationGatewayProtocol = "Tcp" + ApplicationGatewayProtocolTLS ApplicationGatewayProtocol = "Tls" +) + +// PossibleApplicationGatewayProtocolValues returns the possible values for the ApplicationGatewayProtocol const type. +func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { + return []ApplicationGatewayProtocol{ + ApplicationGatewayProtocolHTTP, + ApplicationGatewayProtocolHTTPS, + ApplicationGatewayProtocolTCP, + ApplicationGatewayProtocolTLS, + } +} + +// ApplicationGatewayRedirectType - Redirect type enum. +type ApplicationGatewayRedirectType string + +const ( + ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" + ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" +) + +// PossibleApplicationGatewayRedirectTypeValues returns the possible values for the ApplicationGatewayRedirectType const type. +func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { + return []ApplicationGatewayRedirectType{ + ApplicationGatewayRedirectTypeFound, + ApplicationGatewayRedirectTypePermanent, + ApplicationGatewayRedirectTypeSeeOther, + ApplicationGatewayRedirectTypeTemporary, + } +} + +// ApplicationGatewayRequestRoutingRuleType - Rule type. +type ApplicationGatewayRequestRoutingRuleType string + +const ( + ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" +) + +// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns the possible values for the ApplicationGatewayRequestRoutingRuleType const type. +func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { + return []ApplicationGatewayRequestRoutingRuleType{ + ApplicationGatewayRequestRoutingRuleTypeBasic, + ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, + } +} + +// ApplicationGatewayRuleSetStatusOptions - The rule set status +type ApplicationGatewayRuleSetStatusOptions string + +const ( + ApplicationGatewayRuleSetStatusOptionsDeprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" + ApplicationGatewayRuleSetStatusOptionsGA ApplicationGatewayRuleSetStatusOptions = "GA" + ApplicationGatewayRuleSetStatusOptionsPreview ApplicationGatewayRuleSetStatusOptions = "Preview" + ApplicationGatewayRuleSetStatusOptionsSupported ApplicationGatewayRuleSetStatusOptions = "Supported" +) + +// PossibleApplicationGatewayRuleSetStatusOptionsValues returns the possible values for the ApplicationGatewayRuleSetStatusOptions const type. +func PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGatewayRuleSetStatusOptions { + return []ApplicationGatewayRuleSetStatusOptions{ + ApplicationGatewayRuleSetStatusOptionsDeprecated, + ApplicationGatewayRuleSetStatusOptionsGA, + ApplicationGatewayRuleSetStatusOptionsPreview, + ApplicationGatewayRuleSetStatusOptionsSupported, + } +} + +// ApplicationGatewaySKUName - Name of an application gateway SKU. +type ApplicationGatewaySKUName string + +const ( + ApplicationGatewaySKUNameStandardLarge ApplicationGatewaySKUName = "Standard_Large" + ApplicationGatewaySKUNameStandardMedium ApplicationGatewaySKUName = "Standard_Medium" + ApplicationGatewaySKUNameStandardSmall ApplicationGatewaySKUName = "Standard_Small" + ApplicationGatewaySKUNameStandardV2 ApplicationGatewaySKUName = "Standard_v2" + ApplicationGatewaySKUNameWAFLarge ApplicationGatewaySKUName = "WAF_Large" + ApplicationGatewaySKUNameWAFMedium ApplicationGatewaySKUName = "WAF_Medium" + ApplicationGatewaySKUNameWAFV2 ApplicationGatewaySKUName = "WAF_v2" +) + +// PossibleApplicationGatewaySKUNameValues returns the possible values for the ApplicationGatewaySKUName const type. +func PossibleApplicationGatewaySKUNameValues() []ApplicationGatewaySKUName { + return []ApplicationGatewaySKUName{ + ApplicationGatewaySKUNameStandardLarge, + ApplicationGatewaySKUNameStandardMedium, + ApplicationGatewaySKUNameStandardSmall, + ApplicationGatewaySKUNameStandardV2, + ApplicationGatewaySKUNameWAFLarge, + ApplicationGatewaySKUNameWAFMedium, + ApplicationGatewaySKUNameWAFV2, + } +} + +// ApplicationGatewaySSLCipherSuite - Ssl cipher suites enums. +type ApplicationGatewaySSLCipherSuite string + +const ( + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySSLCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" +) + +// PossibleApplicationGatewaySSLCipherSuiteValues returns the possible values for the ApplicationGatewaySSLCipherSuite const type. +func PossibleApplicationGatewaySSLCipherSuiteValues() []ApplicationGatewaySSLCipherSuite { + return []ApplicationGatewaySSLCipherSuite{ + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA, + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES128CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSDHEDSSWITHAES256CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES128GCMSHA256, + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSDHERSAWITHAES256GCMSHA384, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384, + ApplicationGatewaySSLCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES128GCMSHA256, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256CBCSHA384, + ApplicationGatewaySSLCipherSuiteTLSECDHERSAWITHAES256GCMSHA384, + ApplicationGatewaySSLCipherSuiteTLSRSAWITH3DESEDECBCSHA, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES128GCMSHA256, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256CBCSHA256, + ApplicationGatewaySSLCipherSuiteTLSRSAWITHAES256GCMSHA384, + } +} + +// ApplicationGatewaySSLPolicyName - Ssl predefined policy name enums. +type ApplicationGatewaySSLPolicyName string + +const ( + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20150501" + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401" + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20170401S" + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101 ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101" + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S ApplicationGatewaySSLPolicyName = "AppGwSslPolicy20220101S" +) + +// PossibleApplicationGatewaySSLPolicyNameValues returns the possible values for the ApplicationGatewaySSLPolicyName const type. +func PossibleApplicationGatewaySSLPolicyNameValues() []ApplicationGatewaySSLPolicyName { + return []ApplicationGatewaySSLPolicyName{ + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20150501, + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401, + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20170401S, + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101, + ApplicationGatewaySSLPolicyNameAppGwSSLPolicy20220101S, + } +} + +// ApplicationGatewaySSLPolicyType - Type of Ssl Policy. +type ApplicationGatewaySSLPolicyType string + +const ( + ApplicationGatewaySSLPolicyTypeCustom ApplicationGatewaySSLPolicyType = "Custom" + ApplicationGatewaySSLPolicyTypeCustomV2 ApplicationGatewaySSLPolicyType = "CustomV2" + ApplicationGatewaySSLPolicyTypePredefined ApplicationGatewaySSLPolicyType = "Predefined" +) + +// PossibleApplicationGatewaySSLPolicyTypeValues returns the possible values for the ApplicationGatewaySSLPolicyType const type. +func PossibleApplicationGatewaySSLPolicyTypeValues() []ApplicationGatewaySSLPolicyType { + return []ApplicationGatewaySSLPolicyType{ + ApplicationGatewaySSLPolicyTypeCustom, + ApplicationGatewaySSLPolicyTypeCustomV2, + ApplicationGatewaySSLPolicyTypePredefined, + } +} + +// ApplicationGatewaySSLProtocol - Ssl protocol enums. +type ApplicationGatewaySSLProtocol string + +const ( + ApplicationGatewaySSLProtocolTLSv10 ApplicationGatewaySSLProtocol = "TLSv1_0" + ApplicationGatewaySSLProtocolTLSv11 ApplicationGatewaySSLProtocol = "TLSv1_1" + ApplicationGatewaySSLProtocolTLSv12 ApplicationGatewaySSLProtocol = "TLSv1_2" + ApplicationGatewaySSLProtocolTLSv13 ApplicationGatewaySSLProtocol = "TLSv1_3" +) + +// PossibleApplicationGatewaySSLProtocolValues returns the possible values for the ApplicationGatewaySSLProtocol const type. +func PossibleApplicationGatewaySSLProtocolValues() []ApplicationGatewaySSLProtocol { + return []ApplicationGatewaySSLProtocol{ + ApplicationGatewaySSLProtocolTLSv10, + ApplicationGatewaySSLProtocolTLSv11, + ApplicationGatewaySSLProtocolTLSv12, + ApplicationGatewaySSLProtocolTLSv13, + } +} + +// ApplicationGatewayTier - Tier of an application gateway. +type ApplicationGatewayTier string + +const ( + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" +) + +// PossibleApplicationGatewayTierValues returns the possible values for the ApplicationGatewayTier const type. +func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { + return []ApplicationGatewayTier{ + ApplicationGatewayTierStandard, + ApplicationGatewayTierStandardV2, + ApplicationGatewayTierWAF, + ApplicationGatewayTierWAFV2, + } +} + +type ApplicationGatewayTierTypes string + +const ( + ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" + ApplicationGatewayTierTypesStandardV2 ApplicationGatewayTierTypes = "Standard_v2" + ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" + ApplicationGatewayTierTypesWAFV2 ApplicationGatewayTierTypes = "WAF_v2" +) + +// PossibleApplicationGatewayTierTypesValues returns the possible values for the ApplicationGatewayTierTypes const type. +func PossibleApplicationGatewayTierTypesValues() []ApplicationGatewayTierTypes { + return []ApplicationGatewayTierTypes{ + ApplicationGatewayTierTypesStandard, + ApplicationGatewayTierTypesStandardV2, + ApplicationGatewayTierTypesWAF, + ApplicationGatewayTierTypesWAFV2, + } +} + +// ApplicationGatewayWafRuleActionTypes - The string representation of the web application firewall rule action. +type ApplicationGatewayWafRuleActionTypes string + +const ( + ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" + ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" + ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" + ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" + ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" +) + +// PossibleApplicationGatewayWafRuleActionTypesValues returns the possible values for the ApplicationGatewayWafRuleActionTypes const type. +func PossibleApplicationGatewayWafRuleActionTypesValues() []ApplicationGatewayWafRuleActionTypes { + return []ApplicationGatewayWafRuleActionTypes{ + ApplicationGatewayWafRuleActionTypesAllow, + ApplicationGatewayWafRuleActionTypesAnomalyScoring, + ApplicationGatewayWafRuleActionTypesBlock, + ApplicationGatewayWafRuleActionTypesLog, + ApplicationGatewayWafRuleActionTypesNone, + } +} + +// ApplicationGatewayWafRuleStateTypes - The string representation of the web application firewall rule state. +type ApplicationGatewayWafRuleStateTypes string + +const ( + ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" + ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" +) + +// PossibleApplicationGatewayWafRuleStateTypesValues returns the possible values for the ApplicationGatewayWafRuleStateTypes const type. +func PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWafRuleStateTypes { + return []ApplicationGatewayWafRuleStateTypes{ + ApplicationGatewayWafRuleStateTypesDisabled, + ApplicationGatewayWafRuleStateTypesEnabled, + } +} + +// AssociationType - The association type of the child resource to the parent resource. +type AssociationType string + +const ( + AssociationTypeAssociated AssociationType = "Associated" + AssociationTypeContains AssociationType = "Contains" +) + +// PossibleAssociationTypeValues returns the possible values for the AssociationType const type. +func PossibleAssociationTypeValues() []AssociationType { + return []AssociationType{ + AssociationTypeAssociated, + AssociationTypeContains, + } +} + +// AuthenticationMethod - VPN client authentication method. +type AuthenticationMethod string + +const ( + AuthenticationMethodEAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" +) + +// PossibleAuthenticationMethodValues returns the possible values for the AuthenticationMethod const type. +func PossibleAuthenticationMethodValues() []AuthenticationMethod { + return []AuthenticationMethod{ + AuthenticationMethodEAPMSCHAPv2, + AuthenticationMethodEAPTLS, + } +} + +// AuthorizationUseStatus - The authorization use status. +type AuthorizationUseStatus string + +const ( + AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" + AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" +) + +// PossibleAuthorizationUseStatusValues returns the possible values for the AuthorizationUseStatus const type. +func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { + return []AuthorizationUseStatus{ + AuthorizationUseStatusAvailable, + AuthorizationUseStatusInUse, + } +} + +// AutoLearnPrivateRangesMode - The operation mode for automatically learning private ranges to not be SNAT +type AutoLearnPrivateRangesMode string + +const ( + AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" + AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" +) + +// PossibleAutoLearnPrivateRangesModeValues returns the possible values for the AutoLearnPrivateRangesMode const type. +func PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode { + return []AutoLearnPrivateRangesMode{ + AutoLearnPrivateRangesModeDisabled, + AutoLearnPrivateRangesModeEnabled, + } +} + +// AzureFirewallApplicationRuleProtocolType - The protocol type of a Application Rule resource. +type AzureFirewallApplicationRuleProtocolType string + +const ( + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" + AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" +) + +// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns the possible values for the AzureFirewallApplicationRuleProtocolType const type. +func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { + return []AzureFirewallApplicationRuleProtocolType{ + AzureFirewallApplicationRuleProtocolTypeHTTP, + AzureFirewallApplicationRuleProtocolTypeHTTPS, + AzureFirewallApplicationRuleProtocolTypeMssql, + } +} + +// AzureFirewallNatRCActionType - The action type of a NAT rule collection. +type AzureFirewallNatRCActionType string + +const ( + AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" + AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" +) + +// PossibleAzureFirewallNatRCActionTypeValues returns the possible values for the AzureFirewallNatRCActionType const type. +func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { + return []AzureFirewallNatRCActionType{ + AzureFirewallNatRCActionTypeDnat, + AzureFirewallNatRCActionTypeSnat, + } +} + +// AzureFirewallNetworkRuleProtocol - The protocol of a Network Rule resource. +type AzureFirewallNetworkRuleProtocol string + +const ( + AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" + AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" + AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" + AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" +) + +// PossibleAzureFirewallNetworkRuleProtocolValues returns the possible values for the AzureFirewallNetworkRuleProtocol const type. +func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { + return []AzureFirewallNetworkRuleProtocol{ + AzureFirewallNetworkRuleProtocolAny, + AzureFirewallNetworkRuleProtocolICMP, + AzureFirewallNetworkRuleProtocolTCP, + AzureFirewallNetworkRuleProtocolUDP, + } +} + +// AzureFirewallRCActionType - The action type of a rule collection. +type AzureFirewallRCActionType string + +const ( + AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" +) + +// PossibleAzureFirewallRCActionTypeValues returns the possible values for the AzureFirewallRCActionType const type. +func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { + return []AzureFirewallRCActionType{ + AzureFirewallRCActionTypeAllow, + AzureFirewallRCActionTypeDeny, + } +} + +// AzureFirewallSKUName - Name of an Azure Firewall SKU. +type AzureFirewallSKUName string + +const ( + AzureFirewallSKUNameAZFWHub AzureFirewallSKUName = "AZFW_Hub" + AzureFirewallSKUNameAZFWVnet AzureFirewallSKUName = "AZFW_VNet" +) + +// PossibleAzureFirewallSKUNameValues returns the possible values for the AzureFirewallSKUName const type. +func PossibleAzureFirewallSKUNameValues() []AzureFirewallSKUName { + return []AzureFirewallSKUName{ + AzureFirewallSKUNameAZFWHub, + AzureFirewallSKUNameAZFWVnet, + } +} + +// AzureFirewallSKUTier - Tier of an Azure Firewall. +type AzureFirewallSKUTier string + +const ( + AzureFirewallSKUTierBasic AzureFirewallSKUTier = "Basic" + AzureFirewallSKUTierPremium AzureFirewallSKUTier = "Premium" + AzureFirewallSKUTierStandard AzureFirewallSKUTier = "Standard" +) + +// PossibleAzureFirewallSKUTierValues returns the possible values for the AzureFirewallSKUTier const type. +func PossibleAzureFirewallSKUTierValues() []AzureFirewallSKUTier { + return []AzureFirewallSKUTier{ + AzureFirewallSKUTierBasic, + AzureFirewallSKUTierPremium, + AzureFirewallSKUTierStandard, + } +} + +// AzureFirewallThreatIntelMode - The operation mode for Threat Intel. +type AzureFirewallThreatIntelMode string + +const ( + AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" + AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" + AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" +) + +// PossibleAzureFirewallThreatIntelModeValues returns the possible values for the AzureFirewallThreatIntelMode const type. +func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { + return []AzureFirewallThreatIntelMode{ + AzureFirewallThreatIntelModeAlert, + AzureFirewallThreatIntelModeDeny, + AzureFirewallThreatIntelModeOff, + } +} + +// BastionConnectProtocol - The protocol used to connect to the target. +type BastionConnectProtocol string + +const ( + BastionConnectProtocolRDP BastionConnectProtocol = "RDP" + BastionConnectProtocolSSH BastionConnectProtocol = "SSH" +) + +// PossibleBastionConnectProtocolValues returns the possible values for the BastionConnectProtocol const type. +func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { + return []BastionConnectProtocol{ + BastionConnectProtocolRDP, + BastionConnectProtocolSSH, + } +} + +// BastionHostSKUName - The name of this Bastion Host. +type BastionHostSKUName string + +const ( + BastionHostSKUNameBasic BastionHostSKUName = "Basic" + BastionHostSKUNameStandard BastionHostSKUName = "Standard" +) + +// PossibleBastionHostSKUNameValues returns the possible values for the BastionHostSKUName const type. +func PossibleBastionHostSKUNameValues() []BastionHostSKUName { + return []BastionHostSKUName{ + BastionHostSKUNameBasic, + BastionHostSKUNameStandard, + } +} + +// BgpPeerState - The BGP peer state. +type BgpPeerState string + +const ( + BgpPeerStateConnected BgpPeerState = "Connected" + BgpPeerStateConnecting BgpPeerState = "Connecting" + BgpPeerStateIdle BgpPeerState = "Idle" + BgpPeerStateStopped BgpPeerState = "Stopped" + BgpPeerStateUnknown BgpPeerState = "Unknown" +) + +// PossibleBgpPeerStateValues returns the possible values for the BgpPeerState const type. +func PossibleBgpPeerStateValues() []BgpPeerState { + return []BgpPeerState{ + BgpPeerStateConnected, + BgpPeerStateConnecting, + BgpPeerStateIdle, + BgpPeerStateStopped, + BgpPeerStateUnknown, + } +} + +// CircuitConnectionStatus - Express Route Circuit connection state. +type CircuitConnectionStatus string + +const ( + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" +) + +// PossibleCircuitConnectionStatusValues returns the possible values for the CircuitConnectionStatus const type. +func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { + return []CircuitConnectionStatus{ + CircuitConnectionStatusConnected, + CircuitConnectionStatusConnecting, + CircuitConnectionStatusDisconnected, + } +} + +// CommissionedState - The commissioned state of the Custom IP Prefix. +type CommissionedState string + +const ( + CommissionedStateCommissioned CommissionedState = "Commissioned" + CommissionedStateCommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" + CommissionedStateCommissioning CommissionedState = "Commissioning" + CommissionedStateDecommissioning CommissionedState = "Decommissioning" + CommissionedStateDeprovisioned CommissionedState = "Deprovisioned" + CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" + CommissionedStateProvisioned CommissionedState = "Provisioned" + CommissionedStateProvisioning CommissionedState = "Provisioning" +) + +// PossibleCommissionedStateValues returns the possible values for the CommissionedState const type. +func PossibleCommissionedStateValues() []CommissionedState { + return []CommissionedState{ + CommissionedStateCommissioned, + CommissionedStateCommissionedNoInternetAdvertise, + CommissionedStateCommissioning, + CommissionedStateDecommissioning, + CommissionedStateDeprovisioned, + CommissionedStateDeprovisioning, + CommissionedStateProvisioned, + CommissionedStateProvisioning, + } +} + +// ConfigurationType - Configuration Deployment Type. +type ConfigurationType string + +const ( + ConfigurationTypeConnectivity ConfigurationType = "Connectivity" + ConfigurationTypeSecurityAdmin ConfigurationType = "SecurityAdmin" +) + +// PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. +func PossibleConfigurationTypeValues() []ConfigurationType { + return []ConfigurationType{ + ConfigurationTypeConnectivity, + ConfigurationTypeSecurityAdmin, + } +} + +// ConnectionMonitorEndpointFilterItemType - The type of item included in the filter. Currently only 'AgentAddress' is supported. +type ConnectionMonitorEndpointFilterItemType string + +const ( + ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" +) + +// PossibleConnectionMonitorEndpointFilterItemTypeValues returns the possible values for the ConnectionMonitorEndpointFilterItemType const type. +func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { + return []ConnectionMonitorEndpointFilterItemType{ + ConnectionMonitorEndpointFilterItemTypeAgentAddress, + } +} + +// ConnectionMonitorEndpointFilterType - The behavior of the endpoint filter. Currently only 'Include' is supported. +type ConnectionMonitorEndpointFilterType string + +const ( + ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" +) + +// PossibleConnectionMonitorEndpointFilterTypeValues returns the possible values for the ConnectionMonitorEndpointFilterType const type. +func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { + return []ConnectionMonitorEndpointFilterType{ + ConnectionMonitorEndpointFilterTypeInclude, + } +} + +// ConnectionMonitorSourceStatus - Status of connection monitor source. +type ConnectionMonitorSourceStatus string + +const ( + ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" + ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" + ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" +) + +// PossibleConnectionMonitorSourceStatusValues returns the possible values for the ConnectionMonitorSourceStatus const type. +func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { + return []ConnectionMonitorSourceStatus{ + ConnectionMonitorSourceStatusActive, + ConnectionMonitorSourceStatusInactive, + ConnectionMonitorSourceStatusUnknown, + } +} + +// ConnectionMonitorTestConfigurationProtocol - The protocol to use in test evaluation. +type ConnectionMonitorTestConfigurationProtocol string + +const ( + ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" + ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" + ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" +) + +// PossibleConnectionMonitorTestConfigurationProtocolValues returns the possible values for the ConnectionMonitorTestConfigurationProtocol const type. +func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMonitorTestConfigurationProtocol { + return []ConnectionMonitorTestConfigurationProtocol{ + ConnectionMonitorTestConfigurationProtocolHTTP, + ConnectionMonitorTestConfigurationProtocolIcmp, + ConnectionMonitorTestConfigurationProtocolTCP, + } +} + +// ConnectionMonitorType - Type of connection monitor. +type ConnectionMonitorType string + +const ( + ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" + ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" +) + +// PossibleConnectionMonitorTypeValues returns the possible values for the ConnectionMonitorType const type. +func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { + return []ConnectionMonitorType{ + ConnectionMonitorTypeMultiEndpoint, + ConnectionMonitorTypeSingleSourceDestination, + } +} + +// ConnectionState - The connection state. +type ConnectionState string + +const ( + ConnectionStateReachable ConnectionState = "Reachable" + ConnectionStateUnknown ConnectionState = "Unknown" + ConnectionStateUnreachable ConnectionState = "Unreachable" +) + +// PossibleConnectionStateValues returns the possible values for the ConnectionState const type. +func PossibleConnectionStateValues() []ConnectionState { + return []ConnectionState{ + ConnectionStateReachable, + ConnectionStateUnknown, + ConnectionStateUnreachable, + } +} + +// ConnectionStatus - The connection status. +type ConnectionStatus string + +const ( + ConnectionStatusConnected ConnectionStatus = "Connected" + ConnectionStatusDegraded ConnectionStatus = "Degraded" + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + ConnectionStatusUnknown ConnectionStatus = "Unknown" +) + +// PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ + ConnectionStatusConnected, + ConnectionStatusDegraded, + ConnectionStatusDisconnected, + ConnectionStatusUnknown, + } +} + +// ConnectivityTopology - Connectivity topology type. +type ConnectivityTopology string + +const ( + ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" + ConnectivityTopologyMesh ConnectivityTopology = "Mesh" +) + +// PossibleConnectivityTopologyValues returns the possible values for the ConnectivityTopology const type. +func PossibleConnectivityTopologyValues() []ConnectivityTopology { + return []ConnectivityTopology{ + ConnectivityTopologyHubAndSpoke, + ConnectivityTopologyMesh, + } +} + +// CoverageLevel - Test coverage for the endpoint. +type CoverageLevel string + +const ( + CoverageLevelAboveAverage CoverageLevel = "AboveAverage" + CoverageLevelAverage CoverageLevel = "Average" + CoverageLevelBelowAverage CoverageLevel = "BelowAverage" + CoverageLevelDefault CoverageLevel = "Default" + CoverageLevelFull CoverageLevel = "Full" + CoverageLevelLow CoverageLevel = "Low" +) + +// PossibleCoverageLevelValues returns the possible values for the CoverageLevel const type. +func PossibleCoverageLevelValues() []CoverageLevel { + return []CoverageLevel{ + CoverageLevelAboveAverage, + CoverageLevelAverage, + CoverageLevelBelowAverage, + CoverageLevelDefault, + CoverageLevelFull, + CoverageLevelLow, + } +} + +// 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, + } +} + +// CustomIPPrefixType - Type of custom IP prefix. Should be Singular, Parent, or Child. +type CustomIPPrefixType string + +const ( + CustomIPPrefixTypeChild CustomIPPrefixType = "Child" + CustomIPPrefixTypeParent CustomIPPrefixType = "Parent" + CustomIPPrefixTypeSingular CustomIPPrefixType = "Singular" +) + +// PossibleCustomIPPrefixTypeValues returns the possible values for the CustomIPPrefixType const type. +func PossibleCustomIPPrefixTypeValues() []CustomIPPrefixType { + return []CustomIPPrefixType{ + CustomIPPrefixTypeChild, + CustomIPPrefixTypeParent, + CustomIPPrefixTypeSingular, + } +} + +// DdosSettingsProtectionMode - The DDoS protection mode of the public IP +type DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +// PossibleDdosSettingsProtectionModeValues returns the possible values for the DdosSettingsProtectionMode const type. +func PossibleDdosSettingsProtectionModeValues() []DdosSettingsProtectionMode { + return []DdosSettingsProtectionMode{ + DdosSettingsProtectionModeDisabled, + DdosSettingsProtectionModeEnabled, + DdosSettingsProtectionModeVirtualNetworkInherited, + } +} + +// DeleteExistingPeering - Flag if need to remove current existing peerings. +type DeleteExistingPeering string + +const ( + DeleteExistingPeeringFalse DeleteExistingPeering = "False" + DeleteExistingPeeringTrue DeleteExistingPeering = "True" +) + +// PossibleDeleteExistingPeeringValues returns the possible values for the DeleteExistingPeering const type. +func PossibleDeleteExistingPeeringValues() []DeleteExistingPeering { + return []DeleteExistingPeering{ + DeleteExistingPeeringFalse, + DeleteExistingPeeringTrue, + } +} + +// DeleteOptions - Specify what happens to the public IP address when the VM using it is deleted +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type. +func PossibleDeleteOptionsValues() []DeleteOptions { + return []DeleteOptions{ + DeleteOptionsDelete, + DeleteOptionsDetach, + } +} + +// DeploymentStatus - Deployment Status. +type DeploymentStatus string + +const ( + DeploymentStatusDeployed DeploymentStatus = "Deployed" + DeploymentStatusDeploying DeploymentStatus = "Deploying" + DeploymentStatusFailed DeploymentStatus = "Failed" + DeploymentStatusNotStarted DeploymentStatus = "NotStarted" +) + +// PossibleDeploymentStatusValues returns the possible values for the DeploymentStatus const type. +func PossibleDeploymentStatusValues() []DeploymentStatus { + return []DeploymentStatus{ + DeploymentStatusDeployed, + DeploymentStatusDeploying, + DeploymentStatusFailed, + DeploymentStatusNotStarted, + } +} + +// DestinationPortBehavior - Destination port behavior. +type DestinationPortBehavior string + +const ( + DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" + DestinationPortBehaviorNone DestinationPortBehavior = "None" +) + +// PossibleDestinationPortBehaviorValues returns the possible values for the DestinationPortBehavior const type. +func PossibleDestinationPortBehaviorValues() []DestinationPortBehavior { + return []DestinationPortBehavior{ + DestinationPortBehaviorListenIfAvailable, + DestinationPortBehaviorNone, + } +} + +// DhGroup - The DH Groups used in IKE Phase 1 for initial SA. +type DhGroup string + +const ( + DhGroupDHGroup1 DhGroup = "DHGroup1" + DhGroupDHGroup14 DhGroup = "DHGroup14" + DhGroupDHGroup2 DhGroup = "DHGroup2" + DhGroupDHGroup2048 DhGroup = "DHGroup2048" + DhGroupDHGroup24 DhGroup = "DHGroup24" + DhGroupECP256 DhGroup = "ECP256" + DhGroupECP384 DhGroup = "ECP384" + DhGroupNone DhGroup = "None" +) + +// PossibleDhGroupValues returns the possible values for the DhGroup const type. +func PossibleDhGroupValues() []DhGroup { + return []DhGroup{ + DhGroupDHGroup1, + DhGroupDHGroup14, + DhGroupDHGroup2, + DhGroupDHGroup2048, + DhGroupDHGroup24, + DhGroupECP256, + DhGroupECP384, + DhGroupNone, + } +} + +// Direction - The direction of the traffic. +type Direction string + +const ( + DirectionInbound Direction = "Inbound" + DirectionOutbound Direction = "Outbound" +) + +// PossibleDirectionValues returns the possible values for the Direction const type. +func PossibleDirectionValues() []Direction { + return []Direction{ + DirectionInbound, + DirectionOutbound, + } +} + +// EffectiveAdminRuleKind - Whether the rule is custom or default. +type EffectiveAdminRuleKind string + +const ( + EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" + EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" +) + +// PossibleEffectiveAdminRuleKindValues returns the possible values for the EffectiveAdminRuleKind const type. +func PossibleEffectiveAdminRuleKindValues() []EffectiveAdminRuleKind { + return []EffectiveAdminRuleKind{ + EffectiveAdminRuleKindCustom, + EffectiveAdminRuleKindDefault, + } +} + +// EffectiveRouteSource - Who created the route. +type EffectiveRouteSource string + +const ( + EffectiveRouteSourceDefault EffectiveRouteSource = "Default" + EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" + EffectiveRouteSourceUser EffectiveRouteSource = "User" + EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" +) + +// PossibleEffectiveRouteSourceValues returns the possible values for the EffectiveRouteSource const type. +func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { + return []EffectiveRouteSource{ + EffectiveRouteSourceDefault, + EffectiveRouteSourceUnknown, + EffectiveRouteSourceUser, + EffectiveRouteSourceVirtualNetworkGateway, + } +} + +// EffectiveRouteState - The value of effective route. +type EffectiveRouteState string + +const ( + EffectiveRouteStateActive EffectiveRouteState = "Active" + EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" +) + +// PossibleEffectiveRouteStateValues returns the possible values for the EffectiveRouteState const type. +func PossibleEffectiveRouteStateValues() []EffectiveRouteState { + return []EffectiveRouteState{ + EffectiveRouteStateActive, + EffectiveRouteStateInvalid, + } +} + +// EffectiveSecurityRuleProtocol - The network protocol this rule applies to. +type EffectiveSecurityRuleProtocol string + +const ( + EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" + EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" +) + +// PossibleEffectiveSecurityRuleProtocolValues returns the possible values for the EffectiveSecurityRuleProtocol const type. +func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { + return []EffectiveSecurityRuleProtocol{ + EffectiveSecurityRuleProtocolAll, + EffectiveSecurityRuleProtocolTCP, + EffectiveSecurityRuleProtocolUDP, + } +} + +// EndpointType - The endpoint type. +type EndpointType string + +const ( + EndpointTypeAzureArcVM EndpointType = "AzureArcVM" + EndpointTypeAzureSubnet EndpointType = "AzureSubnet" + EndpointTypeAzureVM EndpointType = "AzureVM" + EndpointTypeAzureVMSS EndpointType = "AzureVMSS" + EndpointTypeAzureVNet EndpointType = "AzureVNet" + EndpointTypeExternalAddress EndpointType = "ExternalAddress" + EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" + EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" +) + +// PossibleEndpointTypeValues returns the possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{ + EndpointTypeAzureArcVM, + EndpointTypeAzureSubnet, + EndpointTypeAzureVM, + EndpointTypeAzureVMSS, + EndpointTypeAzureVNet, + EndpointTypeExternalAddress, + EndpointTypeMMAWorkspaceMachine, + EndpointTypeMMAWorkspaceNetwork, + } +} + +// EvaluationState - Connectivity analysis evaluation state. +type EvaluationState string + +const ( + EvaluationStateCompleted EvaluationState = "Completed" + EvaluationStateInProgress EvaluationState = "InProgress" + EvaluationStateNotStarted EvaluationState = "NotStarted" +) + +// PossibleEvaluationStateValues returns the possible values for the EvaluationState const type. +func PossibleEvaluationStateValues() []EvaluationState { + return []EvaluationState{ + EvaluationStateCompleted, + EvaluationStateInProgress, + EvaluationStateNotStarted, + } +} + +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState - The advertised public prefix state of the Peering resource. +type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string + +const ( + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" +) + +// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns the possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. +func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, + } +} + +// ExpressRouteCircuitPeeringState - The state of peering. +type ExpressRouteCircuitPeeringState string + +const ( + ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" +) + +// PossibleExpressRouteCircuitPeeringStateValues returns the possible values for the ExpressRouteCircuitPeeringState const type. +func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { + return []ExpressRouteCircuitPeeringState{ + ExpressRouteCircuitPeeringStateDisabled, + ExpressRouteCircuitPeeringStateEnabled, + } +} + +// ExpressRouteCircuitSKUFamily - The family of the SKU. +type ExpressRouteCircuitSKUFamily string + +const ( + ExpressRouteCircuitSKUFamilyMeteredData ExpressRouteCircuitSKUFamily = "MeteredData" + ExpressRouteCircuitSKUFamilyUnlimitedData ExpressRouteCircuitSKUFamily = "UnlimitedData" +) + +// PossibleExpressRouteCircuitSKUFamilyValues returns the possible values for the ExpressRouteCircuitSKUFamily const type. +func PossibleExpressRouteCircuitSKUFamilyValues() []ExpressRouteCircuitSKUFamily { + return []ExpressRouteCircuitSKUFamily{ + ExpressRouteCircuitSKUFamilyMeteredData, + ExpressRouteCircuitSKUFamilyUnlimitedData, + } +} + +// ExpressRouteCircuitSKUTier - The tier of the SKU. +type ExpressRouteCircuitSKUTier string + +const ( + ExpressRouteCircuitSKUTierBasic ExpressRouteCircuitSKUTier = "Basic" + ExpressRouteCircuitSKUTierLocal ExpressRouteCircuitSKUTier = "Local" + ExpressRouteCircuitSKUTierPremium ExpressRouteCircuitSKUTier = "Premium" + ExpressRouteCircuitSKUTierStandard ExpressRouteCircuitSKUTier = "Standard" +) + +// PossibleExpressRouteCircuitSKUTierValues returns the possible values for the ExpressRouteCircuitSKUTier const type. +func PossibleExpressRouteCircuitSKUTierValues() []ExpressRouteCircuitSKUTier { + return []ExpressRouteCircuitSKUTier{ + ExpressRouteCircuitSKUTierBasic, + ExpressRouteCircuitSKUTierLocal, + ExpressRouteCircuitSKUTierPremium, + ExpressRouteCircuitSKUTierStandard, + } +} + +// ExpressRouteLinkAdminState - Administrative state of the physical port. +type ExpressRouteLinkAdminState string + +const ( + ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" + ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" +) + +// PossibleExpressRouteLinkAdminStateValues returns the possible values for the ExpressRouteLinkAdminState const type. +func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { + return []ExpressRouteLinkAdminState{ + ExpressRouteLinkAdminStateDisabled, + ExpressRouteLinkAdminStateEnabled, + } +} + +// ExpressRouteLinkConnectorType - Physical fiber port type. +type ExpressRouteLinkConnectorType string + +const ( + ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" + ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" +) + +// PossibleExpressRouteLinkConnectorTypeValues returns the possible values for the ExpressRouteLinkConnectorType const type. +func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { + return []ExpressRouteLinkConnectorType{ + ExpressRouteLinkConnectorTypeLC, + ExpressRouteLinkConnectorTypeSC, + } +} + +// ExpressRouteLinkMacSecCipher - Mac security cipher. +type ExpressRouteLinkMacSecCipher string + +const ( + ExpressRouteLinkMacSecCipherGCMAES128 ExpressRouteLinkMacSecCipher = "GcmAes128" + ExpressRouteLinkMacSecCipherGCMAES256 ExpressRouteLinkMacSecCipher = "GcmAes256" + ExpressRouteLinkMacSecCipherGCMAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" + ExpressRouteLinkMacSecCipherGCMAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" +) + +// PossibleExpressRouteLinkMacSecCipherValues returns the possible values for the ExpressRouteLinkMacSecCipher const type. +func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { + return []ExpressRouteLinkMacSecCipher{ + ExpressRouteLinkMacSecCipherGCMAES128, + ExpressRouteLinkMacSecCipherGCMAES256, + ExpressRouteLinkMacSecCipherGCMAesXpn128, + ExpressRouteLinkMacSecCipherGCMAesXpn256, + } +} + +// ExpressRouteLinkMacSecSciState - Sci mode enabled/disabled. +type ExpressRouteLinkMacSecSciState string + +const ( + ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" + ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" +) + +// PossibleExpressRouteLinkMacSecSciStateValues returns the possible values for the ExpressRouteLinkMacSecSciState const type. +func PossibleExpressRouteLinkMacSecSciStateValues() []ExpressRouteLinkMacSecSciState { + return []ExpressRouteLinkMacSecSciState{ + ExpressRouteLinkMacSecSciStateDisabled, + ExpressRouteLinkMacSecSciStateEnabled, + } +} + +// ExpressRoutePeeringState - The state of peering. +type ExpressRoutePeeringState string + +const ( + ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" +) + +// PossibleExpressRoutePeeringStateValues returns the possible values for the ExpressRoutePeeringState const type. +func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { + return []ExpressRoutePeeringState{ + ExpressRoutePeeringStateDisabled, + ExpressRoutePeeringStateEnabled, + } +} + +// ExpressRoutePeeringType - The peering type. +type ExpressRoutePeeringType string + +const ( + ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" +) + +// PossibleExpressRoutePeeringTypeValues returns the possible values for the ExpressRoutePeeringType const type. +func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { + return []ExpressRoutePeeringType{ + ExpressRoutePeeringTypeAzurePrivatePeering, + ExpressRoutePeeringTypeAzurePublicPeering, + ExpressRoutePeeringTypeMicrosoftPeering, + } +} + +// ExpressRoutePortAuthorizationUseStatus - The authorization use status. +type ExpressRoutePortAuthorizationUseStatus string + +const ( + ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" + ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" +) + +// PossibleExpressRoutePortAuthorizationUseStatusValues returns the possible values for the ExpressRoutePortAuthorizationUseStatus const type. +func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAuthorizationUseStatus { + return []ExpressRoutePortAuthorizationUseStatus{ + ExpressRoutePortAuthorizationUseStatusAvailable, + ExpressRoutePortAuthorizationUseStatusInUse, + } +} + +// ExpressRoutePortsBillingType - The billing type of the ExpressRoutePort resource. +type ExpressRoutePortsBillingType string + +const ( + ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" + ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" +) + +// PossibleExpressRoutePortsBillingTypeValues returns the possible values for the ExpressRoutePortsBillingType const type. +func PossibleExpressRoutePortsBillingTypeValues() []ExpressRoutePortsBillingType { + return []ExpressRoutePortsBillingType{ + ExpressRoutePortsBillingTypeMeteredData, + ExpressRoutePortsBillingTypeUnlimitedData, + } +} + +// ExpressRoutePortsEncapsulation - Encapsulation method on physical ports. +type ExpressRoutePortsEncapsulation string + +const ( + ExpressRoutePortsEncapsulationDot1Q ExpressRoutePortsEncapsulation = "Dot1Q" + ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" +) + +// PossibleExpressRoutePortsEncapsulationValues returns the possible values for the ExpressRoutePortsEncapsulation const type. +func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { + return []ExpressRoutePortsEncapsulation{ + ExpressRoutePortsEncapsulationDot1Q, + ExpressRoutePortsEncapsulationQinQ, + } +} + +// ExtendedLocationTypes - The supported ExtendedLocation types. Currently only EdgeZone is supported in Microsoft.Network +// resources. +type ExtendedLocationTypes string + +const ( + ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" +) + +// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. +func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { + return []ExtendedLocationTypes{ + ExtendedLocationTypesEdgeZone, + } +} + +// FirewallPolicyFilterRuleCollectionActionType - The action type of a rule. +type FirewallPolicyFilterRuleCollectionActionType string + +const ( + FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" + FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" +) + +// PossibleFirewallPolicyFilterRuleCollectionActionTypeValues returns the possible values for the FirewallPolicyFilterRuleCollectionActionType const type. +func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPolicyFilterRuleCollectionActionType { + return []FirewallPolicyFilterRuleCollectionActionType{ + FirewallPolicyFilterRuleCollectionActionTypeAllow, + FirewallPolicyFilterRuleCollectionActionTypeDeny, + } +} + +// FirewallPolicyIDPSQuerySortOrder - Describes if results should be in ascending/descending order +type FirewallPolicyIDPSQuerySortOrder string + +const ( + FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" + FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" +) + +// PossibleFirewallPolicyIDPSQuerySortOrderValues returns the possible values for the FirewallPolicyIDPSQuerySortOrder const type. +func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQuerySortOrder { + return []FirewallPolicyIDPSQuerySortOrder{ + FirewallPolicyIDPSQuerySortOrderAscending, + FirewallPolicyIDPSQuerySortOrderDescending, + } +} + +// FirewallPolicyIDPSSignatureDirection - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, +// 2 - Bidirectional +type FirewallPolicyIDPSSignatureDirection int32 + +const ( + FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 + FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 + FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 +) + +// PossibleFirewallPolicyIDPSSignatureDirectionValues returns the possible values for the FirewallPolicyIDPSSignatureDirection const type. +func PossibleFirewallPolicyIDPSSignatureDirectionValues() []FirewallPolicyIDPSSignatureDirection { + return []FirewallPolicyIDPSSignatureDirection{ + FirewallPolicyIDPSSignatureDirectionZero, + FirewallPolicyIDPSSignatureDirectionOne, + FirewallPolicyIDPSSignatureDirectionTwo, + } +} + +// FirewallPolicyIDPSSignatureMode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny +type FirewallPolicyIDPSSignatureMode int32 + +const ( + FirewallPolicyIDPSSignatureModeZero FirewallPolicyIDPSSignatureMode = 0 + FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 + FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 +) + +// PossibleFirewallPolicyIDPSSignatureModeValues returns the possible values for the FirewallPolicyIDPSSignatureMode const type. +func PossibleFirewallPolicyIDPSSignatureModeValues() []FirewallPolicyIDPSSignatureMode { + return []FirewallPolicyIDPSSignatureMode{ + FirewallPolicyIDPSSignatureModeZero, + FirewallPolicyIDPSSignatureModeOne, + FirewallPolicyIDPSSignatureModeTwo, + } +} + +// FirewallPolicyIDPSSignatureSeverity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High +type FirewallPolicyIDPSSignatureSeverity int32 + +const ( + FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 + FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 + FirewallPolicyIDPSSignatureSeverityThree FirewallPolicyIDPSSignatureSeverity = 3 +) + +// PossibleFirewallPolicyIDPSSignatureSeverityValues returns the possible values for the FirewallPolicyIDPSSignatureSeverity const type. +func PossibleFirewallPolicyIDPSSignatureSeverityValues() []FirewallPolicyIDPSSignatureSeverity { + return []FirewallPolicyIDPSSignatureSeverity{ + FirewallPolicyIDPSSignatureSeverityOne, + FirewallPolicyIDPSSignatureSeverityTwo, + FirewallPolicyIDPSSignatureSeverityThree, + } +} + +// FirewallPolicyIntrusionDetectionProtocol - Possible intrusion detection bypass traffic protocols. +type FirewallPolicyIntrusionDetectionProtocol string + +const ( + FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" + FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" + FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" + FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" +) + +// PossibleFirewallPolicyIntrusionDetectionProtocolValues returns the possible values for the FirewallPolicyIntrusionDetectionProtocol const type. +func PossibleFirewallPolicyIntrusionDetectionProtocolValues() []FirewallPolicyIntrusionDetectionProtocol { + return []FirewallPolicyIntrusionDetectionProtocol{ + FirewallPolicyIntrusionDetectionProtocolANY, + FirewallPolicyIntrusionDetectionProtocolICMP, + FirewallPolicyIntrusionDetectionProtocolTCP, + FirewallPolicyIntrusionDetectionProtocolUDP, + } +} + +// FirewallPolicyIntrusionDetectionStateType - Possible state values. +type FirewallPolicyIntrusionDetectionStateType string + +const ( + FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" + FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" + FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" +) + +// PossibleFirewallPolicyIntrusionDetectionStateTypeValues returns the possible values for the FirewallPolicyIntrusionDetectionStateType const type. +func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyIntrusionDetectionStateType { + return []FirewallPolicyIntrusionDetectionStateType{ + FirewallPolicyIntrusionDetectionStateTypeAlert, + FirewallPolicyIntrusionDetectionStateTypeDeny, + FirewallPolicyIntrusionDetectionStateTypeOff, + } +} + +// FirewallPolicyNatRuleCollectionActionType - The action type of a rule. +type FirewallPolicyNatRuleCollectionActionType string + +const ( + FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" +) + +// PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns the possible values for the FirewallPolicyNatRuleCollectionActionType const type. +func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { + return []FirewallPolicyNatRuleCollectionActionType{ + FirewallPolicyNatRuleCollectionActionTypeDNAT, + } +} + +// FirewallPolicyRuleApplicationProtocolType - The application protocol type of a Rule. +type FirewallPolicyRuleApplicationProtocolType string + +const ( + FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" + FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" +) + +// PossibleFirewallPolicyRuleApplicationProtocolTypeValues returns the possible values for the FirewallPolicyRuleApplicationProtocolType const type. +func PossibleFirewallPolicyRuleApplicationProtocolTypeValues() []FirewallPolicyRuleApplicationProtocolType { + return []FirewallPolicyRuleApplicationProtocolType{ + FirewallPolicyRuleApplicationProtocolTypeHTTP, + FirewallPolicyRuleApplicationProtocolTypeHTTPS, + } +} + +// FirewallPolicyRuleCollectionType - The type of the rule collection. +type FirewallPolicyRuleCollectionType string + +const ( + FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyFilterRuleCollection" + FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" +) + +// PossibleFirewallPolicyRuleCollectionTypeValues returns the possible values for the FirewallPolicyRuleCollectionType const type. +func PossibleFirewallPolicyRuleCollectionTypeValues() []FirewallPolicyRuleCollectionType { + return []FirewallPolicyRuleCollectionType{ + FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection, + FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection, + } +} + +// FirewallPolicyRuleNetworkProtocol - The Network protocol of a Rule. +type FirewallPolicyRuleNetworkProtocol string + +const ( + FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" + FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" + FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" + FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" +) + +// PossibleFirewallPolicyRuleNetworkProtocolValues returns the possible values for the FirewallPolicyRuleNetworkProtocol const type. +func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetworkProtocol { + return []FirewallPolicyRuleNetworkProtocol{ + FirewallPolicyRuleNetworkProtocolAny, + FirewallPolicyRuleNetworkProtocolICMP, + FirewallPolicyRuleNetworkProtocolTCP, + FirewallPolicyRuleNetworkProtocolUDP, + } +} + +// FirewallPolicyRuleType - Rule Type. +type FirewallPolicyRuleType string + +const ( + FirewallPolicyRuleTypeApplicationRule FirewallPolicyRuleType = "ApplicationRule" + FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" + FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" +) + +// PossibleFirewallPolicyRuleTypeValues returns the possible values for the FirewallPolicyRuleType const type. +func PossibleFirewallPolicyRuleTypeValues() []FirewallPolicyRuleType { + return []FirewallPolicyRuleType{ + FirewallPolicyRuleTypeApplicationRule, + FirewallPolicyRuleTypeNatRule, + FirewallPolicyRuleTypeNetworkRule, + } +} + +// FirewallPolicySKUTier - Tier of Firewall Policy. +type FirewallPolicySKUTier string + +const ( + FirewallPolicySKUTierBasic FirewallPolicySKUTier = "Basic" + FirewallPolicySKUTierPremium FirewallPolicySKUTier = "Premium" + FirewallPolicySKUTierStandard FirewallPolicySKUTier = "Standard" +) + +// PossibleFirewallPolicySKUTierValues returns the possible values for the FirewallPolicySKUTier const type. +func PossibleFirewallPolicySKUTierValues() []FirewallPolicySKUTier { + return []FirewallPolicySKUTier{ + FirewallPolicySKUTierBasic, + FirewallPolicySKUTierPremium, + FirewallPolicySKUTierStandard, + } +} + +// FlowLogFormatType - The file type of flow log. +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +// PossibleFlowLogFormatTypeValues returns the possible values for the FlowLogFormatType const type. +func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { + return []FlowLogFormatType{ + FlowLogFormatTypeJSON, + } +} + +// GatewayLoadBalancerTunnelInterfaceType - Traffic type of gateway load balancer tunnel interface. +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +// PossibleGatewayLoadBalancerTunnelInterfaceTypeValues returns the possible values for the GatewayLoadBalancerTunnelInterfaceType const type. +func PossibleGatewayLoadBalancerTunnelInterfaceTypeValues() []GatewayLoadBalancerTunnelInterfaceType { + return []GatewayLoadBalancerTunnelInterfaceType{ + GatewayLoadBalancerTunnelInterfaceTypeExternal, + GatewayLoadBalancerTunnelInterfaceTypeInternal, + GatewayLoadBalancerTunnelInterfaceTypeNone, + } +} + +// GatewayLoadBalancerTunnelProtocol - Protocol of gateway load balancer tunnel interface. +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +// PossibleGatewayLoadBalancerTunnelProtocolValues returns the possible values for the GatewayLoadBalancerTunnelProtocol const type. +func PossibleGatewayLoadBalancerTunnelProtocolValues() []GatewayLoadBalancerTunnelProtocol { + return []GatewayLoadBalancerTunnelProtocol{ + GatewayLoadBalancerTunnelProtocolNative, + GatewayLoadBalancerTunnelProtocolNone, + GatewayLoadBalancerTunnelProtocolVXLAN, + } +} + +// Geo - The Geo for CIDR advertising. Should be an Geo code. +type Geo string + +const ( + GeoAFRI Geo = "AFRI" + GeoAPAC Geo = "APAC" + GeoAQ Geo = "AQ" + GeoEURO Geo = "EURO" + GeoGLOBAL Geo = "GLOBAL" + GeoLATAM Geo = "LATAM" + GeoME Geo = "ME" + GeoNAM Geo = "NAM" + GeoOCEANIA Geo = "OCEANIA" +) + +// PossibleGeoValues returns the possible values for the Geo const type. +func PossibleGeoValues() []Geo { + return []Geo{ + GeoAFRI, + GeoAPAC, + GeoAQ, + GeoEURO, + GeoGLOBAL, + GeoLATAM, + GeoME, + GeoNAM, + GeoOCEANIA, + } +} + +// GroupConnectivity - Group connectivity type. +type GroupConnectivity string + +const ( + GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" + GroupConnectivityNone GroupConnectivity = "None" +) + +// PossibleGroupConnectivityValues returns the possible values for the GroupConnectivity const type. +func PossibleGroupConnectivityValues() []GroupConnectivity { + return []GroupConnectivity{ + GroupConnectivityDirectlyConnected, + GroupConnectivityNone, + } +} + +// HTTPConfigurationMethod - The HTTP method to use. +type HTTPConfigurationMethod string + +const ( + HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" + HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" +) + +// PossibleHTTPConfigurationMethodValues returns the possible values for the HTTPConfigurationMethod const type. +func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { + return []HTTPConfigurationMethod{ + HTTPConfigurationMethodGet, + HTTPConfigurationMethodPost, + } +} + +// HTTPMethod - HTTP method. +type HTTPMethod string + +const ( + HTTPMethodGet HTTPMethod = "Get" +) + +// PossibleHTTPMethodValues returns the possible values for the HTTPMethod const type. +func PossibleHTTPMethodValues() []HTTPMethod { + return []HTTPMethod{ + HTTPMethodGet, + } +} + +// HubBgpConnectionStatus - The current state of the VirtualHub to Peer. +type HubBgpConnectionStatus string + +const ( + HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" + HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" + HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" + HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" +) + +// PossibleHubBgpConnectionStatusValues returns the possible values for the HubBgpConnectionStatus const type. +func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { + return []HubBgpConnectionStatus{ + HubBgpConnectionStatusConnected, + HubBgpConnectionStatusConnecting, + HubBgpConnectionStatusNotConnected, + HubBgpConnectionStatusUnknown, + } +} + +// HubRoutingPreference - The hub routing preference gateway types +type HubRoutingPreference string + +const ( + HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" + HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" + HubRoutingPreferenceVPNGateway HubRoutingPreference = "VpnGateway" +) + +// PossibleHubRoutingPreferenceValues returns the possible values for the HubRoutingPreference const type. +func PossibleHubRoutingPreferenceValues() []HubRoutingPreference { + return []HubRoutingPreference{ + HubRoutingPreferenceASPath, + HubRoutingPreferenceExpressRoute, + HubRoutingPreferenceVPNGateway, + } +} + +// HubVirtualNetworkConnectionStatus - The current state of the VirtualHub to vnet connection. +type HubVirtualNetworkConnectionStatus string + +const ( + HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" + HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" + HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" + HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" +) + +// PossibleHubVirtualNetworkConnectionStatusValues returns the possible values for the HubVirtualNetworkConnectionStatus const type. +func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { + return []HubVirtualNetworkConnectionStatus{ + HubVirtualNetworkConnectionStatusConnected, + HubVirtualNetworkConnectionStatusConnecting, + HubVirtualNetworkConnectionStatusNotConnected, + HubVirtualNetworkConnectionStatusUnknown, + } +} + +// IPAllocationMethod - IP address allocation method. +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +// PossibleIPAllocationMethodValues returns the possible values for the IPAllocationMethod const type. +func PossibleIPAllocationMethodValues() []IPAllocationMethod { + return []IPAllocationMethod{ + IPAllocationMethodDynamic, + IPAllocationMethodStatic, + } +} + +// IPAllocationType - IpAllocation type. +type IPAllocationType string + +const ( + IPAllocationTypeHypernet IPAllocationType = "Hypernet" + IPAllocationTypeUndefined IPAllocationType = "Undefined" +) + +// PossibleIPAllocationTypeValues returns the possible values for the IPAllocationType const type. +func PossibleIPAllocationTypeValues() []IPAllocationType { + return []IPAllocationType{ + IPAllocationTypeHypernet, + IPAllocationTypeUndefined, + } +} + +// IPFlowProtocol - Protocol to be verified on. +type IPFlowProtocol string + +const ( + IPFlowProtocolTCP IPFlowProtocol = "TCP" + IPFlowProtocolUDP IPFlowProtocol = "UDP" +) + +// PossibleIPFlowProtocolValues returns the possible values for the IPFlowProtocol const type. +func PossibleIPFlowProtocolValues() []IPFlowProtocol { + return []IPFlowProtocol{ + IPFlowProtocolTCP, + IPFlowProtocolUDP, + } +} + +// IPSecEncryption - The IPSec encryption algorithm (IKE phase 1). +type IPSecEncryption string + +const ( + IPSecEncryptionAES128 IPSecEncryption = "AES128" + IPSecEncryptionAES192 IPSecEncryption = "AES192" + IPSecEncryptionAES256 IPSecEncryption = "AES256" + IPSecEncryptionDES IPSecEncryption = "DES" + IPSecEncryptionDES3 IPSecEncryption = "DES3" + IPSecEncryptionGCMAES128 IPSecEncryption = "GCMAES128" + IPSecEncryptionGCMAES192 IPSecEncryption = "GCMAES192" + IPSecEncryptionGCMAES256 IPSecEncryption = "GCMAES256" + IPSecEncryptionNone IPSecEncryption = "None" +) + +// PossibleIPSecEncryptionValues returns the possible values for the IPSecEncryption const type. +func PossibleIPSecEncryptionValues() []IPSecEncryption { + return []IPSecEncryption{ + IPSecEncryptionAES128, + IPSecEncryptionAES192, + IPSecEncryptionAES256, + IPSecEncryptionDES, + IPSecEncryptionDES3, + IPSecEncryptionGCMAES128, + IPSecEncryptionGCMAES192, + IPSecEncryptionGCMAES256, + IPSecEncryptionNone, + } +} + +// IPSecIntegrity - The IPSec integrity algorithm (IKE phase 1). +type IPSecIntegrity string + +const ( + IPSecIntegrityGCMAES128 IPSecIntegrity = "GCMAES128" + IPSecIntegrityGCMAES192 IPSecIntegrity = "GCMAES192" + IPSecIntegrityGCMAES256 IPSecIntegrity = "GCMAES256" + IPSecIntegrityMD5 IPSecIntegrity = "MD5" + IPSecIntegritySHA1 IPSecIntegrity = "SHA1" + IPSecIntegritySHA256 IPSecIntegrity = "SHA256" +) + +// PossibleIPSecIntegrityValues returns the possible values for the IPSecIntegrity const type. +func PossibleIPSecIntegrityValues() []IPSecIntegrity { + return []IPSecIntegrity{ + IPSecIntegrityGCMAES128, + IPSecIntegrityGCMAES192, + IPSecIntegrityGCMAES256, + IPSecIntegrityMD5, + IPSecIntegritySHA1, + IPSecIntegritySHA256, + } +} + +// IPVersion - IP address version. +type IPVersion string + +const ( + IPVersionIPv4 IPVersion = "IPv4" + IPVersionIPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns the possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{ + IPVersionIPv4, + IPVersionIPv6, + } +} + +// IkeEncryption - The IKE encryption algorithm (IKE phase 2). +type IkeEncryption string + +const ( + IkeEncryptionAES128 IkeEncryption = "AES128" + IkeEncryptionAES192 IkeEncryption = "AES192" + IkeEncryptionAES256 IkeEncryption = "AES256" + IkeEncryptionDES IkeEncryption = "DES" + IkeEncryptionDES3 IkeEncryption = "DES3" + IkeEncryptionGCMAES128 IkeEncryption = "GCMAES128" + IkeEncryptionGCMAES256 IkeEncryption = "GCMAES256" +) + +// PossibleIkeEncryptionValues returns the possible values for the IkeEncryption const type. +func PossibleIkeEncryptionValues() []IkeEncryption { + return []IkeEncryption{ + IkeEncryptionAES128, + IkeEncryptionAES192, + IkeEncryptionAES256, + IkeEncryptionDES, + IkeEncryptionDES3, + IkeEncryptionGCMAES128, + IkeEncryptionGCMAES256, + } +} + +// IkeIntegrity - The IKE integrity algorithm (IKE phase 2). +type IkeIntegrity string + +const ( + IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" + IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" + IkeIntegrityMD5 IkeIntegrity = "MD5" + IkeIntegritySHA1 IkeIntegrity = "SHA1" + IkeIntegritySHA256 IkeIntegrity = "SHA256" + IkeIntegritySHA384 IkeIntegrity = "SHA384" +) + +// PossibleIkeIntegrityValues returns the possible values for the IkeIntegrity const type. +func PossibleIkeIntegrityValues() []IkeIntegrity { + return []IkeIntegrity{ + IkeIntegrityGCMAES128, + IkeIntegrityGCMAES256, + IkeIntegrityMD5, + IkeIntegritySHA1, + IkeIntegritySHA256, + IkeIntegritySHA384, + } +} + +// InboundSecurityRulesProtocol - Protocol. This should be either TCP or UDP. +type InboundSecurityRulesProtocol string + +const ( + InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" + InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" +) + +// PossibleInboundSecurityRulesProtocolValues returns the possible values for the InboundSecurityRulesProtocol const type. +func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol { + return []InboundSecurityRulesProtocol{ + InboundSecurityRulesProtocolTCP, + InboundSecurityRulesProtocolUDP, + } +} + +// IsGlobal - Flag if global mesh is supported. +type IsGlobal string + +const ( + IsGlobalFalse IsGlobal = "False" + IsGlobalTrue IsGlobal = "True" +) + +// PossibleIsGlobalValues returns the possible values for the IsGlobal const type. +func PossibleIsGlobalValues() []IsGlobal { + return []IsGlobal{ + IsGlobalFalse, + IsGlobalTrue, + } +} + +// IsWorkloadProtected - Value indicating whether the IP address is DDoS workload protected or not. +type IsWorkloadProtected string + +const ( + IsWorkloadProtectedFalse IsWorkloadProtected = "False" + IsWorkloadProtectedTrue IsWorkloadProtected = "True" +) + +// PossibleIsWorkloadProtectedValues returns the possible values for the IsWorkloadProtected const type. +func PossibleIsWorkloadProtectedValues() []IsWorkloadProtected { + return []IsWorkloadProtected{ + IsWorkloadProtectedFalse, + IsWorkloadProtectedTrue, + } +} + +// IssueType - The type of issue. +type IssueType string + +const ( + IssueTypeAgentStopped IssueType = "AgentStopped" + IssueTypeDNSResolution IssueType = "DnsResolution" + IssueTypeGuestFirewall IssueType = "GuestFirewall" + IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" + IssueTypePlatform IssueType = "Platform" + IssueTypePortThrottled IssueType = "PortThrottled" + IssueTypeSocketBind IssueType = "SocketBind" + IssueTypeUnknown IssueType = "Unknown" + IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" +) + +// PossibleIssueTypeValues returns the possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{ + IssueTypeAgentStopped, + IssueTypeDNSResolution, + IssueTypeGuestFirewall, + IssueTypeNetworkSecurityRule, + IssueTypePlatform, + IssueTypePortThrottled, + IssueTypeSocketBind, + IssueTypeUnknown, + IssueTypeUserDefinedRoute, + } +} + +// LoadBalancerBackendAddressAdminState - A list of administrative states which once set can override health probe so that +// Load Balancer will always forward new connections to backend, or deny new connections and reset existing connections. +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +// PossibleLoadBalancerBackendAddressAdminStateValues returns the possible values for the LoadBalancerBackendAddressAdminState const type. +func PossibleLoadBalancerBackendAddressAdminStateValues() []LoadBalancerBackendAddressAdminState { + return []LoadBalancerBackendAddressAdminState{ + LoadBalancerBackendAddressAdminStateDown, + LoadBalancerBackendAddressAdminStateDrain, + LoadBalancerBackendAddressAdminStateNone, + LoadBalancerBackendAddressAdminStateUp, + } +} + +// LoadBalancerOutboundRuleProtocol - The protocol for the outbound rule in load balancer. +type LoadBalancerOutboundRuleProtocol string + +const ( + LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" + LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" + LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" +) + +// PossibleLoadBalancerOutboundRuleProtocolValues returns the possible values for the LoadBalancerOutboundRuleProtocol const type. +func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { + return []LoadBalancerOutboundRuleProtocol{ + LoadBalancerOutboundRuleProtocolAll, + LoadBalancerOutboundRuleProtocolTCP, + LoadBalancerOutboundRuleProtocolUDP, + } +} + +// LoadBalancerSKUName - Name of a load balancer SKU. +type LoadBalancerSKUName string + +const ( + LoadBalancerSKUNameBasic LoadBalancerSKUName = "Basic" + LoadBalancerSKUNameGateway LoadBalancerSKUName = "Gateway" + LoadBalancerSKUNameStandard LoadBalancerSKUName = "Standard" +) + +// PossibleLoadBalancerSKUNameValues returns the possible values for the LoadBalancerSKUName const type. +func PossibleLoadBalancerSKUNameValues() []LoadBalancerSKUName { + return []LoadBalancerSKUName{ + LoadBalancerSKUNameBasic, + LoadBalancerSKUNameGateway, + LoadBalancerSKUNameStandard, + } +} + +// LoadBalancerSKUTier - Tier of a load balancer SKU. +type LoadBalancerSKUTier string + +const ( + LoadBalancerSKUTierGlobal LoadBalancerSKUTier = "Global" + LoadBalancerSKUTierRegional LoadBalancerSKUTier = "Regional" +) + +// PossibleLoadBalancerSKUTierValues returns the possible values for the LoadBalancerSKUTier const type. +func PossibleLoadBalancerSKUTierValues() []LoadBalancerSKUTier { + return []LoadBalancerSKUTier{ + LoadBalancerSKUTierGlobal, + LoadBalancerSKUTierRegional, + } +} + +// LoadDistribution - The load distribution policy for this rule. +type LoadDistribution string + +const ( + LoadDistributionDefault LoadDistribution = "Default" + LoadDistributionSourceIP LoadDistribution = "SourceIP" + LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" +) + +// PossibleLoadDistributionValues returns the possible values for the LoadDistribution const type. +func PossibleLoadDistributionValues() []LoadDistribution { + return []LoadDistribution{ + LoadDistributionDefault, + LoadDistributionSourceIP, + LoadDistributionSourceIPProtocol, + } +} + +// ManagedRuleEnabledState - The state of the managed rule. Defaults to Disabled if not specified. +type ManagedRuleEnabledState string + +const ( + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" +) + +// PossibleManagedRuleEnabledStateValues returns the possible values for the ManagedRuleEnabledState const type. +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return []ManagedRuleEnabledState{ + ManagedRuleEnabledStateDisabled, + ManagedRuleEnabledStateEnabled, + } +} + +// NatGatewaySKUName - Name of Nat Gateway SKU. +type NatGatewaySKUName string + +const ( + NatGatewaySKUNameStandard NatGatewaySKUName = "Standard" +) + +// PossibleNatGatewaySKUNameValues returns the possible values for the NatGatewaySKUName const type. +func PossibleNatGatewaySKUNameValues() []NatGatewaySKUName { + return []NatGatewaySKUName{ + NatGatewaySKUNameStandard, + } +} + +// NetworkIntentPolicyBasedService - Network intent policy based services. +type NetworkIntentPolicyBasedService string + +const ( + NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" + NetworkIntentPolicyBasedServiceAllowRulesOnly NetworkIntentPolicyBasedService = "AllowRulesOnly" + NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" +) + +// PossibleNetworkIntentPolicyBasedServiceValues returns the possible values for the NetworkIntentPolicyBasedService const type. +func PossibleNetworkIntentPolicyBasedServiceValues() []NetworkIntentPolicyBasedService { + return []NetworkIntentPolicyBasedService{ + NetworkIntentPolicyBasedServiceAll, + NetworkIntentPolicyBasedServiceAllowRulesOnly, + NetworkIntentPolicyBasedServiceNone, + } +} + +// NetworkInterfaceAuxiliaryMode - Auxiliary mode of Network Interface resource. +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +// PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type. +func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode { + return []NetworkInterfaceAuxiliaryMode{ + NetworkInterfaceAuxiliaryModeFloating, + NetworkInterfaceAuxiliaryModeMaxConnections, + NetworkInterfaceAuxiliaryModeNone, + } +} + +// NetworkInterfaceMigrationPhase - Migration phase of Network Interface resource. +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +// PossibleNetworkInterfaceMigrationPhaseValues returns the possible values for the NetworkInterfaceMigrationPhase const type. +func PossibleNetworkInterfaceMigrationPhaseValues() []NetworkInterfaceMigrationPhase { + return []NetworkInterfaceMigrationPhase{ + NetworkInterfaceMigrationPhaseAbort, + NetworkInterfaceMigrationPhaseCommit, + NetworkInterfaceMigrationPhaseCommitted, + NetworkInterfaceMigrationPhaseNone, + NetworkInterfaceMigrationPhasePrepare, + } +} + +// NetworkInterfaceNicType - Type of Network Interface resource. +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +// PossibleNetworkInterfaceNicTypeValues returns the possible values for the NetworkInterfaceNicType const type. +func PossibleNetworkInterfaceNicTypeValues() []NetworkInterfaceNicType { + return []NetworkInterfaceNicType{ + NetworkInterfaceNicTypeElastic, + NetworkInterfaceNicTypeStandard, + } +} + +// NetworkOperationStatus - Status of the Azure async operation. +type NetworkOperationStatus string + +const ( + NetworkOperationStatusFailed NetworkOperationStatus = "Failed" + NetworkOperationStatusInProgress NetworkOperationStatus = "InProgress" + NetworkOperationStatusSucceeded NetworkOperationStatus = "Succeeded" +) + +// PossibleNetworkOperationStatusValues returns the possible values for the NetworkOperationStatus const type. +func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { + return []NetworkOperationStatus{ + NetworkOperationStatusFailed, + NetworkOperationStatusInProgress, + NetworkOperationStatusSucceeded, + } +} + +// NextHopType - Next hop type. +type NextHopType string + +const ( + NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" + NextHopTypeInternet NextHopType = "Internet" + NextHopTypeNone NextHopType = "None" + NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" + NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" + NextHopTypeVnetLocal NextHopType = "VnetLocal" +) + +// PossibleNextHopTypeValues returns the possible values for the NextHopType const type. +func PossibleNextHopTypeValues() []NextHopType { + return []NextHopType{ + NextHopTypeHyperNetGateway, + NextHopTypeInternet, + NextHopTypeNone, + NextHopTypeVirtualAppliance, + NextHopTypeVirtualNetworkGateway, + NextHopTypeVnetLocal, + } +} + +// NextStep - Supported next step behaviors after a rule is applied to a matched route +type NextStep string + +const ( + NextStepContinue NextStep = "Continue" + NextStepTerminate NextStep = "Terminate" + NextStepUnknown NextStep = "Unknown" +) + +// PossibleNextStepValues returns the possible values for the NextStep const type. +func PossibleNextStepValues() []NextStep { + return []NextStep{ + NextStepContinue, + NextStepTerminate, + NextStepUnknown, + } +} + +// OfficeTrafficCategory - The office traffic category. +type OfficeTrafficCategory string + +const ( + OfficeTrafficCategoryAll OfficeTrafficCategory = "All" + OfficeTrafficCategoryNone OfficeTrafficCategory = "None" + OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" +) + +// PossibleOfficeTrafficCategoryValues returns the possible values for the OfficeTrafficCategory const type. +func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { + return []OfficeTrafficCategory{ + OfficeTrafficCategoryAll, + OfficeTrafficCategoryNone, + OfficeTrafficCategoryOptimize, + OfficeTrafficCategoryOptimizeAndAllow, + } +} + +// Origin - The origin of the issue. +type Origin string + +const ( + OriginInbound Origin = "Inbound" + OriginLocal Origin = "Local" + OriginOutbound Origin = "Outbound" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginInbound, + OriginLocal, + OriginOutbound, + } +} + +// OutputType - Connection monitor output destination type. Currently, only "Workspace" is supported. +type OutputType string + +const ( + OutputTypeWorkspace OutputType = "Workspace" +) + +// PossibleOutputTypeValues returns the possible values for the OutputType const type. +func PossibleOutputTypeValues() []OutputType { + return []OutputType{ + OutputTypeWorkspace, + } +} + +// OwaspCrsExclusionEntryMatchVariable - The variable to be excluded. +type OwaspCrsExclusionEntryMatchVariable string + +const ( + OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" + OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" + OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" + OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" + OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" + OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" +) + +// PossibleOwaspCrsExclusionEntryMatchVariableValues returns the possible values for the OwaspCrsExclusionEntryMatchVariable const type. +func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { + return []OwaspCrsExclusionEntryMatchVariable{ + OwaspCrsExclusionEntryMatchVariableRequestArgKeys, + OwaspCrsExclusionEntryMatchVariableRequestArgNames, + OwaspCrsExclusionEntryMatchVariableRequestArgValues, + OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, + OwaspCrsExclusionEntryMatchVariableRequestCookieNames, + OwaspCrsExclusionEntryMatchVariableRequestCookieValues, + OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, + OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, + OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, + } +} + +// OwaspCrsExclusionEntrySelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which +// elements in the collection this exclusion applies to. +type OwaspCrsExclusionEntrySelectorMatchOperator string + +const ( + OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" + OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" + OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" + OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" + OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" +) + +// PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues returns the possible values for the OwaspCrsExclusionEntrySelectorMatchOperator const type. +func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclusionEntrySelectorMatchOperator { + return []OwaspCrsExclusionEntrySelectorMatchOperator{ + OwaspCrsExclusionEntrySelectorMatchOperatorContains, + OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, + OwaspCrsExclusionEntrySelectorMatchOperatorEquals, + OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, + OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, + } +} + +// PacketCaptureTargetType - Target type of the resource provided. +type PacketCaptureTargetType string + +const ( + PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" + PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" +) + +// PossiblePacketCaptureTargetTypeValues returns the possible values for the PacketCaptureTargetType const type. +func PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType { + return []PacketCaptureTargetType{ + PacketCaptureTargetTypeAzureVM, + PacketCaptureTargetTypeAzureVMSS, + } +} + +type PcError string + +const ( + PcErrorAgentStopped PcError = "AgentStopped" + PcErrorCaptureFailed PcError = "CaptureFailed" + PcErrorInternalError PcError = "InternalError" + PcErrorLocalFileFailed PcError = "LocalFileFailed" + PcErrorStorageFailed PcError = "StorageFailed" +) + +// PossiblePcErrorValues returns the possible values for the PcError const type. +func PossiblePcErrorValues() []PcError { + return []PcError{ + PcErrorAgentStopped, + PcErrorCaptureFailed, + PcErrorInternalError, + PcErrorLocalFileFailed, + PcErrorStorageFailed, + } +} + +// PcProtocol - Protocol to be filtered on. +type PcProtocol string + +const ( + PcProtocolAny PcProtocol = "Any" + PcProtocolTCP PcProtocol = "TCP" + PcProtocolUDP PcProtocol = "UDP" +) + +// PossiblePcProtocolValues returns the possible values for the PcProtocol const type. +func PossiblePcProtocolValues() []PcProtocol { + return []PcProtocol{ + PcProtocolAny, + PcProtocolTCP, + PcProtocolUDP, + } +} + +// PcStatus - The status of the packet capture session. +type PcStatus string + +const ( + PcStatusError PcStatus = "Error" + PcStatusNotStarted PcStatus = "NotStarted" + PcStatusRunning PcStatus = "Running" + PcStatusStopped PcStatus = "Stopped" + PcStatusUnknown PcStatus = "Unknown" +) + +// PossiblePcStatusValues returns the possible values for the PcStatus const type. +func PossiblePcStatusValues() []PcStatus { + return []PcStatus{ + PcStatusError, + PcStatusNotStarted, + PcStatusRunning, + PcStatusStopped, + PcStatusUnknown, + } +} + +// PfsGroup - The Pfs Groups used in IKE Phase 2 for new child SA. +type PfsGroup string + +const ( + PfsGroupECP256 PfsGroup = "ECP256" + PfsGroupECP384 PfsGroup = "ECP384" + PfsGroupNone PfsGroup = "None" + PfsGroupPFS1 PfsGroup = "PFS1" + PfsGroupPFS14 PfsGroup = "PFS14" + PfsGroupPFS2 PfsGroup = "PFS2" + PfsGroupPFS2048 PfsGroup = "PFS2048" + PfsGroupPFS24 PfsGroup = "PFS24" + PfsGroupPFSMM PfsGroup = "PFSMM" +) + +// PossiblePfsGroupValues returns the possible values for the PfsGroup const type. +func PossiblePfsGroupValues() []PfsGroup { + return []PfsGroup{ + PfsGroupECP256, + PfsGroupECP384, + PfsGroupNone, + PfsGroupPFS1, + PfsGroupPFS14, + PfsGroupPFS2, + PfsGroupPFS2048, + PfsGroupPFS24, + PfsGroupPFSMM, + } +} + +// PreferredIPVersion - The preferred IP version to use in test evaluation. The connection monitor may choose to use a different +// version depending on other parameters. +type PreferredIPVersion string + +const ( + PreferredIPVersionIPv4 PreferredIPVersion = "IPv4" + PreferredIPVersionIPv6 PreferredIPVersion = "IPv6" +) + +// PossiblePreferredIPVersionValues returns the possible values for the PreferredIPVersion const type. +func PossiblePreferredIPVersionValues() []PreferredIPVersion { + return []PreferredIPVersion{ + PreferredIPVersionIPv4, + PreferredIPVersionIPv6, + } +} + +// PreferredRoutingGateway - The preferred routing gateway types +type PreferredRoutingGateway string + +const ( + PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" + PreferredRoutingGatewayNone PreferredRoutingGateway = "None" + PreferredRoutingGatewayVPNGateway PreferredRoutingGateway = "VpnGateway" +) + +// PossiblePreferredRoutingGatewayValues returns the possible values for the PreferredRoutingGateway const type. +func PossiblePreferredRoutingGatewayValues() []PreferredRoutingGateway { + return []PreferredRoutingGateway{ + PreferredRoutingGatewayExpressRoute, + PreferredRoutingGatewayNone, + PreferredRoutingGatewayVPNGateway, + } +} + +// ProbeProtocol - The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. +// If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required +// for the probe to be successful. +type ProbeProtocol string + +const ( + ProbeProtocolHTTP ProbeProtocol = "Http" + ProbeProtocolHTTPS ProbeProtocol = "Https" + ProbeProtocolTCP ProbeProtocol = "Tcp" +) + +// PossibleProbeProtocolValues returns the possible values for the ProbeProtocol const type. +func PossibleProbeProtocolValues() []ProbeProtocol { + return []ProbeProtocol{ + ProbeProtocolHTTP, + ProbeProtocolHTTPS, + ProbeProtocolTCP, + } +} + +// ProcessorArchitecture - VPN client Processor Architecture. +type ProcessorArchitecture string + +const ( + ProcessorArchitectureAmd64 ProcessorArchitecture = "Amd64" + ProcessorArchitectureX86 ProcessorArchitecture = "X86" +) + +// PossibleProcessorArchitectureValues returns the possible values for the ProcessorArchitecture const type. +func PossibleProcessorArchitectureValues() []ProcessorArchitecture { + return []ProcessorArchitecture{ + ProcessorArchitectureAmd64, + ProcessorArchitectureX86, + } +} + +// Protocol - Network protocol. +type Protocol string + +const ( + ProtocolHTTP Protocol = "Http" + ProtocolHTTPS Protocol = "Https" + ProtocolIcmp Protocol = "Icmp" + ProtocolTCP Protocol = "Tcp" +) + +// PossibleProtocolValues returns the possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ + ProtocolHTTP, + ProtocolHTTPS, + ProtocolIcmp, + ProtocolTCP, + } +} + +// ProtocolType - RNM supported protocol types. +type ProtocolType string + +const ( + ProtocolTypeAh ProtocolType = "Ah" + ProtocolTypeAll ProtocolType = "All" + ProtocolTypeDoNotUse ProtocolType = "DoNotUse" + ProtocolTypeEsp ProtocolType = "Esp" + ProtocolTypeGre ProtocolType = "Gre" + ProtocolTypeIcmp ProtocolType = "Icmp" + ProtocolTypeTCP ProtocolType = "Tcp" + ProtocolTypeUDP ProtocolType = "Udp" + ProtocolTypeVxlan ProtocolType = "Vxlan" +) + +// PossibleProtocolTypeValues returns the possible values for the ProtocolType const type. +func PossibleProtocolTypeValues() []ProtocolType { + return []ProtocolType{ + ProtocolTypeAh, + ProtocolTypeAll, + ProtocolTypeDoNotUse, + ProtocolTypeEsp, + ProtocolTypeGre, + ProtocolTypeIcmp, + ProtocolTypeTCP, + ProtocolTypeUDP, + ProtocolTypeVxlan, + } +} + +// ProvisioningState - The current provisioning state. +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// PublicIPAddressMigrationPhase - Migration phase of Public IP Address. +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +// PossiblePublicIPAddressMigrationPhaseValues returns the possible values for the PublicIPAddressMigrationPhase const type. +func PossiblePublicIPAddressMigrationPhaseValues() []PublicIPAddressMigrationPhase { + return []PublicIPAddressMigrationPhase{ + PublicIPAddressMigrationPhaseAbort, + PublicIPAddressMigrationPhaseCommit, + PublicIPAddressMigrationPhaseCommitted, + PublicIPAddressMigrationPhaseNone, + PublicIPAddressMigrationPhasePrepare, + } +} + +// PublicIPAddressSKUName - Name of a public IP address SKU. +type PublicIPAddressSKUName string + +const ( + PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" + PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" +) + +// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type. +func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { + return []PublicIPAddressSKUName{ + PublicIPAddressSKUNameBasic, + PublicIPAddressSKUNameStandard, + } +} + +// PublicIPAddressSKUTier - Tier of a public IP address SKU. +type PublicIPAddressSKUTier string + +const ( + PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" + PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" +) + +// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type. +func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { + return []PublicIPAddressSKUTier{ + PublicIPAddressSKUTierGlobal, + PublicIPAddressSKUTierRegional, + } +} + +// PublicIPPrefixSKUName - Name of a public IP prefix SKU. +type PublicIPPrefixSKUName string + +const ( + PublicIPPrefixSKUNameStandard PublicIPPrefixSKUName = "Standard" +) + +// PossiblePublicIPPrefixSKUNameValues returns the possible values for the PublicIPPrefixSKUName const type. +func PossiblePublicIPPrefixSKUNameValues() []PublicIPPrefixSKUName { + return []PublicIPPrefixSKUName{ + PublicIPPrefixSKUNameStandard, + } +} + +// PublicIPPrefixSKUTier - Tier of a public IP prefix SKU. +type PublicIPPrefixSKUTier string + +const ( + PublicIPPrefixSKUTierGlobal PublicIPPrefixSKUTier = "Global" + PublicIPPrefixSKUTierRegional PublicIPPrefixSKUTier = "Regional" +) + +// PossiblePublicIPPrefixSKUTierValues returns the possible values for the PublicIPPrefixSKUTier const type. +func PossiblePublicIPPrefixSKUTierValues() []PublicIPPrefixSKUTier { + return []PublicIPPrefixSKUTier{ + PublicIPPrefixSKUTierGlobal, + PublicIPPrefixSKUTierRegional, + } +} + +// ResourceIdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both +// an implicitly created identity and a set of user assigned identities. The type 'None' will remove any +// identities from the virtual machine. +type ResourceIdentityType string + +const ( + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + ResourceIdentityTypeNone ResourceIdentityType = "None" +) + +// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ + ResourceIdentityTypeSystemAssigned, + ResourceIdentityTypeUserAssigned, + ResourceIdentityTypeSystemAssignedUserAssigned, + ResourceIdentityTypeNone, + } +} + +// RouteFilterRuleType - The rule type of the rule. +type RouteFilterRuleType string + +const ( + RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" +) + +// PossibleRouteFilterRuleTypeValues returns the possible values for the RouteFilterRuleType const type. +func PossibleRouteFilterRuleTypeValues() []RouteFilterRuleType { + return []RouteFilterRuleType{ + RouteFilterRuleTypeCommunity, + } +} + +// RouteMapActionType - Kind of actions which can be taken on a matched route. Add, Replace, Remove refer to parameters on +// the route, like community or prefix +type RouteMapActionType string + +const ( + RouteMapActionTypeAdd RouteMapActionType = "Add" + RouteMapActionTypeDrop RouteMapActionType = "Drop" + RouteMapActionTypeRemove RouteMapActionType = "Remove" + RouteMapActionTypeReplace RouteMapActionType = "Replace" + RouteMapActionTypeUnknown RouteMapActionType = "Unknown" +) + +// PossibleRouteMapActionTypeValues returns the possible values for the RouteMapActionType const type. +func PossibleRouteMapActionTypeValues() []RouteMapActionType { + return []RouteMapActionType{ + RouteMapActionTypeAdd, + RouteMapActionTypeDrop, + RouteMapActionTypeRemove, + RouteMapActionTypeReplace, + RouteMapActionTypeUnknown, + } +} + +// RouteMapMatchCondition - Match condition to apply RouteMap rules. +type RouteMapMatchCondition string + +const ( + RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" + RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" + RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" + RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" + RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" +) + +// PossibleRouteMapMatchConditionValues returns the possible values for the RouteMapMatchCondition const type. +func PossibleRouteMapMatchConditionValues() []RouteMapMatchCondition { + return []RouteMapMatchCondition{ + RouteMapMatchConditionContains, + RouteMapMatchConditionEquals, + RouteMapMatchConditionNotContains, + RouteMapMatchConditionNotEquals, + RouteMapMatchConditionUnknown, + } +} + +// RouteNextHopType - The type of Azure hop the packet should be sent to. +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +// PossibleRouteNextHopTypeValues returns the possible values for the RouteNextHopType const type. +func PossibleRouteNextHopTypeValues() []RouteNextHopType { + return []RouteNextHopType{ + RouteNextHopTypeInternet, + RouteNextHopTypeNone, + RouteNextHopTypeVirtualAppliance, + RouteNextHopTypeVirtualNetworkGateway, + RouteNextHopTypeVnetLocal, + } +} + +// RoutingState - The current routing state of the VirtualHub. +type RoutingState string + +const ( + RoutingStateFailed RoutingState = "Failed" + RoutingStateNone RoutingState = "None" + RoutingStateProvisioned RoutingState = "Provisioned" + RoutingStateProvisioning RoutingState = "Provisioning" +) + +// PossibleRoutingStateValues returns the possible values for the RoutingState const type. +func PossibleRoutingStateValues() []RoutingState { + return []RoutingState{ + RoutingStateFailed, + RoutingStateNone, + RoutingStateProvisioned, + RoutingStateProvisioning, + } +} + +// ScopeConnectionState - The current scope connection state. +type ScopeConnectionState string + +const ( + ScopeConnectionStateConflict ScopeConnectionState = "Conflict" + ScopeConnectionStateConnected ScopeConnectionState = "Connected" + ScopeConnectionStatePending ScopeConnectionState = "Pending" + ScopeConnectionStateRejected ScopeConnectionState = "Rejected" + ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" +) + +// PossibleScopeConnectionStateValues returns the possible values for the ScopeConnectionState const type. +func PossibleScopeConnectionStateValues() []ScopeConnectionState { + return []ScopeConnectionState{ + ScopeConnectionStateConflict, + ScopeConnectionStateConnected, + ScopeConnectionStatePending, + ScopeConnectionStateRejected, + ScopeConnectionStateRevoked, + } +} + +// SecurityConfigurationRuleAccess - Whether network traffic is allowed or denied. +type SecurityConfigurationRuleAccess string + +const ( + SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" + SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" + SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" +) + +// PossibleSecurityConfigurationRuleAccessValues returns the possible values for the SecurityConfigurationRuleAccess const type. +func PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess { + return []SecurityConfigurationRuleAccess{ + SecurityConfigurationRuleAccessAllow, + SecurityConfigurationRuleAccessAlwaysAllow, + SecurityConfigurationRuleAccessDeny, + } +} + +// SecurityConfigurationRuleDirection - The direction of the rule. The direction specifies if the rule will be evaluated on +// incoming or outgoing traffic. +type SecurityConfigurationRuleDirection string + +const ( + SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" + SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" +) + +// PossibleSecurityConfigurationRuleDirectionValues returns the possible values for the SecurityConfigurationRuleDirection const type. +func PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection { + return []SecurityConfigurationRuleDirection{ + SecurityConfigurationRuleDirectionInbound, + SecurityConfigurationRuleDirectionOutbound, + } +} + +// SecurityConfigurationRuleProtocol - Network protocol this rule applies to. +type SecurityConfigurationRuleProtocol string + +const ( + SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" + SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" + SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" + SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" + SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" + SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" +) + +// PossibleSecurityConfigurationRuleProtocolValues returns the possible values for the SecurityConfigurationRuleProtocol const type. +func PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol { + return []SecurityConfigurationRuleProtocol{ + SecurityConfigurationRuleProtocolAh, + SecurityConfigurationRuleProtocolAny, + SecurityConfigurationRuleProtocolEsp, + SecurityConfigurationRuleProtocolIcmp, + SecurityConfigurationRuleProtocolTCP, + SecurityConfigurationRuleProtocolUDP, + } +} + +// SecurityPartnerProviderConnectionStatus - The current state of the connection with Security Partner Provider. +type SecurityPartnerProviderConnectionStatus string + +const ( + SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" + SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" + SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" + SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" +) + +// PossibleSecurityPartnerProviderConnectionStatusValues returns the possible values for the SecurityPartnerProviderConnectionStatus const type. +func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerProviderConnectionStatus { + return []SecurityPartnerProviderConnectionStatus{ + SecurityPartnerProviderConnectionStatusConnected, + SecurityPartnerProviderConnectionStatusNotConnected, + SecurityPartnerProviderConnectionStatusPartiallyConnected, + SecurityPartnerProviderConnectionStatusUnknown, + } +} + +// SecurityProviderName - The Security Providers. +type SecurityProviderName string + +const ( + SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" + SecurityProviderNameIBoss SecurityProviderName = "IBoss" + SecurityProviderNameZScaler SecurityProviderName = "ZScaler" +) + +// PossibleSecurityProviderNameValues returns the possible values for the SecurityProviderName const type. +func PossibleSecurityProviderNameValues() []SecurityProviderName { + return []SecurityProviderName{ + SecurityProviderNameCheckpoint, + SecurityProviderNameIBoss, + SecurityProviderNameZScaler, + } +} + +// SecurityRuleAccess - Whether network traffic is allowed or denied. +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +// PossibleSecurityRuleAccessValues returns the possible values for the SecurityRuleAccess const type. +func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { + return []SecurityRuleAccess{ + SecurityRuleAccessAllow, + SecurityRuleAccessDeny, + } +} + +// SecurityRuleDirection - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing +// traffic. +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +// PossibleSecurityRuleDirectionValues returns the possible values for the SecurityRuleDirection const type. +func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { + return []SecurityRuleDirection{ + SecurityRuleDirectionInbound, + SecurityRuleDirectionOutbound, + } +} + +// SecurityRuleProtocol - Network protocol this rule applies to. +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" +) + +// PossibleSecurityRuleProtocolValues returns the possible values for the SecurityRuleProtocol const type. +func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { + return []SecurityRuleProtocol{ + SecurityRuleProtocolAh, + SecurityRuleProtocolAsterisk, + SecurityRuleProtocolEsp, + SecurityRuleProtocolIcmp, + SecurityRuleProtocolTCP, + SecurityRuleProtocolUDP, + } +} + +// ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. +type ServiceProviderProvisioningState string + +const ( + ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" + ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" + ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" + ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" +) + +// PossibleServiceProviderProvisioningStateValues returns the possible values for the ServiceProviderProvisioningState const type. +func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { + return []ServiceProviderProvisioningState{ + ServiceProviderProvisioningStateDeprovisioning, + ServiceProviderProvisioningStateNotProvisioned, + ServiceProviderProvisioningStateProvisioned, + ServiceProviderProvisioningStateProvisioning, + } +} + +// Severity - The 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, + } +} + +// SlotType - Specifies slot info on a cloud service +type SlotType string + +const ( + SlotTypeProduction SlotType = "Production" + SlotTypeStaging SlotType = "Staging" +) + +// PossibleSlotTypeValues returns the possible values for the SlotType const type. +func PossibleSlotTypeValues() []SlotType { + return []SlotType{ + SlotTypeProduction, + SlotTypeStaging, + } +} + +type SyncRemoteAddressSpace string + +const ( + SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" +) + +// PossibleSyncRemoteAddressSpaceValues returns the possible values for the SyncRemoteAddressSpace const type. +func PossibleSyncRemoteAddressSpaceValues() []SyncRemoteAddressSpace { + return []SyncRemoteAddressSpace{ + SyncRemoteAddressSpaceTrue, + } +} + +// TransportProtocol - The transport protocol for the endpoint. +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTCP TransportProtocol = "Tcp" + TransportProtocolUDP TransportProtocol = "Udp" +) + +// PossibleTransportProtocolValues returns the possible values for the TransportProtocol const type. +func PossibleTransportProtocolValues() []TransportProtocol { + return []TransportProtocol{ + TransportProtocolAll, + TransportProtocolTCP, + TransportProtocolUDP, + } +} + +// TunnelConnectionStatus - The current state of the tunnel. +type TunnelConnectionStatus string + +const ( + TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" + TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" + TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" + TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" +) + +// PossibleTunnelConnectionStatusValues returns the possible values for the TunnelConnectionStatus const type. +func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { + return []TunnelConnectionStatus{ + TunnelConnectionStatusConnected, + TunnelConnectionStatusConnecting, + TunnelConnectionStatusNotConnected, + TunnelConnectionStatusUnknown, + } +} + +// UsageUnit - An enum describing the unit of measurement. +type UsageUnit string + +const ( + UsageUnitCount UsageUnit = "Count" +) + +// PossibleUsageUnitValues returns the possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{ + UsageUnitCount, + } +} + +// UseHubGateway - Flag if need to use hub gateway. +type UseHubGateway string + +const ( + UseHubGatewayFalse UseHubGateway = "False" + UseHubGatewayTrue UseHubGateway = "True" +) + +// PossibleUseHubGatewayValues returns the possible values for the UseHubGateway const type. +func PossibleUseHubGatewayValues() []UseHubGateway { + return []UseHubGateway{ + UseHubGatewayFalse, + UseHubGatewayTrue, + } +} + +// VPNAuthenticationType - VPN authentication types enabled for the virtual network gateway. +type VPNAuthenticationType string + +const ( + VPNAuthenticationTypeAAD VPNAuthenticationType = "AAD" + VPNAuthenticationTypeCertificate VPNAuthenticationType = "Certificate" + VPNAuthenticationTypeRadius VPNAuthenticationType = "Radius" +) + +// PossibleVPNAuthenticationTypeValues returns the possible values for the VPNAuthenticationType const type. +func PossibleVPNAuthenticationTypeValues() []VPNAuthenticationType { + return []VPNAuthenticationType{ + VPNAuthenticationTypeAAD, + VPNAuthenticationTypeCertificate, + VPNAuthenticationTypeRadius, + } +} + +// VPNClientProtocol - VPN client protocol enabled for the virtual network gateway. +type VPNClientProtocol string + +const ( + VPNClientProtocolIkeV2 VPNClientProtocol = "IkeV2" + VPNClientProtocolOpenVPN VPNClientProtocol = "OpenVPN" + VPNClientProtocolSSTP VPNClientProtocol = "SSTP" +) + +// PossibleVPNClientProtocolValues returns the possible values for the VPNClientProtocol const type. +func PossibleVPNClientProtocolValues() []VPNClientProtocol { + return []VPNClientProtocol{ + VPNClientProtocolIkeV2, + VPNClientProtocolOpenVPN, + VPNClientProtocolSSTP, + } +} + +// VPNConnectionStatus - The current state of the vpn connection. +type VPNConnectionStatus string + +const ( + VPNConnectionStatusConnected VPNConnectionStatus = "Connected" + VPNConnectionStatusConnecting VPNConnectionStatus = "Connecting" + VPNConnectionStatusNotConnected VPNConnectionStatus = "NotConnected" + VPNConnectionStatusUnknown VPNConnectionStatus = "Unknown" +) + +// PossibleVPNConnectionStatusValues returns the possible values for the VPNConnectionStatus const type. +func PossibleVPNConnectionStatusValues() []VPNConnectionStatus { + return []VPNConnectionStatus{ + VPNConnectionStatusConnected, + VPNConnectionStatusConnecting, + VPNConnectionStatusNotConnected, + VPNConnectionStatusUnknown, + } +} + +// VPNGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. +type VPNGatewayGeneration string + +const ( + VPNGatewayGenerationGeneration1 VPNGatewayGeneration = "Generation1" + VPNGatewayGenerationGeneration2 VPNGatewayGeneration = "Generation2" + VPNGatewayGenerationNone VPNGatewayGeneration = "None" +) + +// PossibleVPNGatewayGenerationValues returns the possible values for the VPNGatewayGeneration const type. +func PossibleVPNGatewayGenerationValues() []VPNGatewayGeneration { + return []VPNGatewayGeneration{ + VPNGatewayGenerationGeneration1, + VPNGatewayGenerationGeneration2, + VPNGatewayGenerationNone, + } +} + +// VPNGatewayTunnelingProtocol - VPN protocol enabled for the VpnServerConfiguration. +type VPNGatewayTunnelingProtocol string + +const ( + VPNGatewayTunnelingProtocolIkeV2 VPNGatewayTunnelingProtocol = "IkeV2" + VPNGatewayTunnelingProtocolOpenVPN VPNGatewayTunnelingProtocol = "OpenVPN" +) + +// PossibleVPNGatewayTunnelingProtocolValues returns the possible values for the VPNGatewayTunnelingProtocol const type. +func PossibleVPNGatewayTunnelingProtocolValues() []VPNGatewayTunnelingProtocol { + return []VPNGatewayTunnelingProtocol{ + VPNGatewayTunnelingProtocolIkeV2, + VPNGatewayTunnelingProtocolOpenVPN, + } +} + +// VPNLinkConnectionMode - Vpn link connection mode. +type VPNLinkConnectionMode string + +const ( + VPNLinkConnectionModeDefault VPNLinkConnectionMode = "Default" + VPNLinkConnectionModeInitiatorOnly VPNLinkConnectionMode = "InitiatorOnly" + VPNLinkConnectionModeResponderOnly VPNLinkConnectionMode = "ResponderOnly" +) + +// PossibleVPNLinkConnectionModeValues returns the possible values for the VPNLinkConnectionMode const type. +func PossibleVPNLinkConnectionModeValues() []VPNLinkConnectionMode { + return []VPNLinkConnectionMode{ + VPNLinkConnectionModeDefault, + VPNLinkConnectionModeInitiatorOnly, + VPNLinkConnectionModeResponderOnly, + } +} + +// VPNNatRuleMode - The Source NAT direction of a VPN NAT. +type VPNNatRuleMode string + +const ( + VPNNatRuleModeEgressSnat VPNNatRuleMode = "EgressSnat" + VPNNatRuleModeIngressSnat VPNNatRuleMode = "IngressSnat" +) + +// PossibleVPNNatRuleModeValues returns the possible values for the VPNNatRuleMode const type. +func PossibleVPNNatRuleModeValues() []VPNNatRuleMode { + return []VPNNatRuleMode{ + VPNNatRuleModeEgressSnat, + VPNNatRuleModeIngressSnat, + } +} + +// VPNNatRuleType - The type of NAT rule for VPN NAT. +type VPNNatRuleType string + +const ( + VPNNatRuleTypeDynamic VPNNatRuleType = "Dynamic" + VPNNatRuleTypeStatic VPNNatRuleType = "Static" +) + +// PossibleVPNNatRuleTypeValues returns the possible values for the VPNNatRuleType const type. +func PossibleVPNNatRuleTypeValues() []VPNNatRuleType { + return []VPNNatRuleType{ + VPNNatRuleTypeDynamic, + VPNNatRuleTypeStatic, + } +} + +// VPNPolicyMemberAttributeType - The Vpn Policy member attribute type. +type VPNPolicyMemberAttributeType string + +const ( + VPNPolicyMemberAttributeTypeAADGroupID VPNPolicyMemberAttributeType = "AADGroupId" + VPNPolicyMemberAttributeTypeCertificateGroupID VPNPolicyMemberAttributeType = "CertificateGroupId" + VPNPolicyMemberAttributeTypeRadiusAzureGroupID VPNPolicyMemberAttributeType = "RadiusAzureGroupId" +) + +// PossibleVPNPolicyMemberAttributeTypeValues returns the possible values for the VPNPolicyMemberAttributeType const type. +func PossibleVPNPolicyMemberAttributeTypeValues() []VPNPolicyMemberAttributeType { + return []VPNPolicyMemberAttributeType{ + VPNPolicyMemberAttributeTypeAADGroupID, + VPNPolicyMemberAttributeTypeCertificateGroupID, + VPNPolicyMemberAttributeTypeRadiusAzureGroupID, + } +} + +// VPNType - The type of this virtual network gateway. +type VPNType string + +const ( + VPNTypePolicyBased VPNType = "PolicyBased" + VPNTypeRouteBased VPNType = "RouteBased" +) + +// PossibleVPNTypeValues returns the possible values for the VPNType const type. +func PossibleVPNTypeValues() []VPNType { + return []VPNType{ + VPNTypePolicyBased, + VPNTypeRouteBased, + } +} + +// VerbosityLevel - Verbosity level. +type VerbosityLevel string + +const ( + VerbosityLevelFull VerbosityLevel = "Full" + VerbosityLevelMinimum VerbosityLevel = "Minimum" + VerbosityLevelNormal VerbosityLevel = "Normal" +) + +// PossibleVerbosityLevelValues returns the possible values for the VerbosityLevel const type. +func PossibleVerbosityLevelValues() []VerbosityLevel { + return []VerbosityLevel{ + VerbosityLevelFull, + VerbosityLevelMinimum, + VerbosityLevelNormal, + } +} + +// VirtualNetworkEncryptionEnforcement - If the encrypted VNet allows VM that does not support encryption +type VirtualNetworkEncryptionEnforcement string + +const ( + VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" + VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" +) + +// PossibleVirtualNetworkEncryptionEnforcementValues returns the possible values for the VirtualNetworkEncryptionEnforcement const type. +func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncryptionEnforcement { + return []VirtualNetworkEncryptionEnforcement{ + VirtualNetworkEncryptionEnforcementAllowUnencrypted, + VirtualNetworkEncryptionEnforcementDropUnencrypted, + } +} + +// VirtualNetworkGatewayConnectionMode - Gateway connection type. +type VirtualNetworkGatewayConnectionMode string + +const ( + VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" + VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" + VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" +) + +// PossibleVirtualNetworkGatewayConnectionModeValues returns the possible values for the VirtualNetworkGatewayConnectionMode const type. +func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGatewayConnectionMode { + return []VirtualNetworkGatewayConnectionMode{ + VirtualNetworkGatewayConnectionModeDefault, + VirtualNetworkGatewayConnectionModeInitiatorOnly, + VirtualNetworkGatewayConnectionModeResponderOnly, + } +} + +// VirtualNetworkGatewayConnectionProtocol - Gateway connection protocol. +type VirtualNetworkGatewayConnectionProtocol string + +const ( + VirtualNetworkGatewayConnectionProtocolIKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + VirtualNetworkGatewayConnectionProtocolIKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +// PossibleVirtualNetworkGatewayConnectionProtocolValues returns the possible values for the VirtualNetworkGatewayConnectionProtocol const type. +func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { + return []VirtualNetworkGatewayConnectionProtocol{ + VirtualNetworkGatewayConnectionProtocolIKEv1, + VirtualNetworkGatewayConnectionProtocolIKEv2, + } +} + +// VirtualNetworkGatewayConnectionStatus - Virtual Network Gateway connection status. +type VirtualNetworkGatewayConnectionStatus string + +const ( + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" +) + +// PossibleVirtualNetworkGatewayConnectionStatusValues returns the possible values for the VirtualNetworkGatewayConnectionStatus const type. +func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { + return []VirtualNetworkGatewayConnectionStatus{ + VirtualNetworkGatewayConnectionStatusConnected, + VirtualNetworkGatewayConnectionStatusConnecting, + VirtualNetworkGatewayConnectionStatusNotConnected, + VirtualNetworkGatewayConnectionStatusUnknown, + } +} + +// VirtualNetworkGatewayConnectionType - Gateway connection type. +type VirtualNetworkGatewayConnectionType string + +const ( + VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" + VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" +) + +// PossibleVirtualNetworkGatewayConnectionTypeValues returns the possible values for the VirtualNetworkGatewayConnectionType const type. +func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { + return []VirtualNetworkGatewayConnectionType{ + VirtualNetworkGatewayConnectionTypeExpressRoute, + VirtualNetworkGatewayConnectionTypeIPsec, + VirtualNetworkGatewayConnectionTypeVPNClient, + VirtualNetworkGatewayConnectionTypeVnet2Vnet, + } +} + +// VirtualNetworkGatewaySKUName - Gateway SKU name. +type VirtualNetworkGatewaySKUName string + +const ( + VirtualNetworkGatewaySKUNameBasic VirtualNetworkGatewaySKUName = "Basic" + VirtualNetworkGatewaySKUNameErGw1AZ VirtualNetworkGatewaySKUName = "ErGw1AZ" + VirtualNetworkGatewaySKUNameErGw2AZ VirtualNetworkGatewaySKUName = "ErGw2AZ" + VirtualNetworkGatewaySKUNameErGw3AZ VirtualNetworkGatewaySKUName = "ErGw3AZ" + VirtualNetworkGatewaySKUNameHighPerformance VirtualNetworkGatewaySKUName = "HighPerformance" + VirtualNetworkGatewaySKUNameStandard VirtualNetworkGatewaySKUName = "Standard" + VirtualNetworkGatewaySKUNameUltraPerformance VirtualNetworkGatewaySKUName = "UltraPerformance" + VirtualNetworkGatewaySKUNameVPNGw1 VirtualNetworkGatewaySKUName = "VpnGw1" + VirtualNetworkGatewaySKUNameVPNGw1AZ VirtualNetworkGatewaySKUName = "VpnGw1AZ" + VirtualNetworkGatewaySKUNameVPNGw2 VirtualNetworkGatewaySKUName = "VpnGw2" + VirtualNetworkGatewaySKUNameVPNGw2AZ VirtualNetworkGatewaySKUName = "VpnGw2AZ" + VirtualNetworkGatewaySKUNameVPNGw3 VirtualNetworkGatewaySKUName = "VpnGw3" + VirtualNetworkGatewaySKUNameVPNGw3AZ VirtualNetworkGatewaySKUName = "VpnGw3AZ" + VirtualNetworkGatewaySKUNameVPNGw4 VirtualNetworkGatewaySKUName = "VpnGw4" + VirtualNetworkGatewaySKUNameVPNGw4AZ VirtualNetworkGatewaySKUName = "VpnGw4AZ" + VirtualNetworkGatewaySKUNameVPNGw5 VirtualNetworkGatewaySKUName = "VpnGw5" + VirtualNetworkGatewaySKUNameVPNGw5AZ VirtualNetworkGatewaySKUName = "VpnGw5AZ" +) + +// PossibleVirtualNetworkGatewaySKUNameValues returns the possible values for the VirtualNetworkGatewaySKUName const type. +func PossibleVirtualNetworkGatewaySKUNameValues() []VirtualNetworkGatewaySKUName { + return []VirtualNetworkGatewaySKUName{ + VirtualNetworkGatewaySKUNameBasic, + VirtualNetworkGatewaySKUNameErGw1AZ, + VirtualNetworkGatewaySKUNameErGw2AZ, + VirtualNetworkGatewaySKUNameErGw3AZ, + VirtualNetworkGatewaySKUNameHighPerformance, + VirtualNetworkGatewaySKUNameStandard, + VirtualNetworkGatewaySKUNameUltraPerformance, + VirtualNetworkGatewaySKUNameVPNGw1, + VirtualNetworkGatewaySKUNameVPNGw1AZ, + VirtualNetworkGatewaySKUNameVPNGw2, + VirtualNetworkGatewaySKUNameVPNGw2AZ, + VirtualNetworkGatewaySKUNameVPNGw3, + VirtualNetworkGatewaySKUNameVPNGw3AZ, + VirtualNetworkGatewaySKUNameVPNGw4, + VirtualNetworkGatewaySKUNameVPNGw4AZ, + VirtualNetworkGatewaySKUNameVPNGw5, + VirtualNetworkGatewaySKUNameVPNGw5AZ, + } +} + +// VirtualNetworkGatewaySKUTier - Gateway SKU tier. +type VirtualNetworkGatewaySKUTier string + +const ( + VirtualNetworkGatewaySKUTierBasic VirtualNetworkGatewaySKUTier = "Basic" + VirtualNetworkGatewaySKUTierErGw1AZ VirtualNetworkGatewaySKUTier = "ErGw1AZ" + VirtualNetworkGatewaySKUTierErGw2AZ VirtualNetworkGatewaySKUTier = "ErGw2AZ" + VirtualNetworkGatewaySKUTierErGw3AZ VirtualNetworkGatewaySKUTier = "ErGw3AZ" + VirtualNetworkGatewaySKUTierHighPerformance VirtualNetworkGatewaySKUTier = "HighPerformance" + VirtualNetworkGatewaySKUTierStandard VirtualNetworkGatewaySKUTier = "Standard" + VirtualNetworkGatewaySKUTierUltraPerformance VirtualNetworkGatewaySKUTier = "UltraPerformance" + VirtualNetworkGatewaySKUTierVPNGw1 VirtualNetworkGatewaySKUTier = "VpnGw1" + VirtualNetworkGatewaySKUTierVPNGw1AZ VirtualNetworkGatewaySKUTier = "VpnGw1AZ" + VirtualNetworkGatewaySKUTierVPNGw2 VirtualNetworkGatewaySKUTier = "VpnGw2" + VirtualNetworkGatewaySKUTierVPNGw2AZ VirtualNetworkGatewaySKUTier = "VpnGw2AZ" + VirtualNetworkGatewaySKUTierVPNGw3 VirtualNetworkGatewaySKUTier = "VpnGw3" + VirtualNetworkGatewaySKUTierVPNGw3AZ VirtualNetworkGatewaySKUTier = "VpnGw3AZ" + VirtualNetworkGatewaySKUTierVPNGw4 VirtualNetworkGatewaySKUTier = "VpnGw4" + VirtualNetworkGatewaySKUTierVPNGw4AZ VirtualNetworkGatewaySKUTier = "VpnGw4AZ" + VirtualNetworkGatewaySKUTierVPNGw5 VirtualNetworkGatewaySKUTier = "VpnGw5" + VirtualNetworkGatewaySKUTierVPNGw5AZ VirtualNetworkGatewaySKUTier = "VpnGw5AZ" +) + +// PossibleVirtualNetworkGatewaySKUTierValues returns the possible values for the VirtualNetworkGatewaySKUTier const type. +func PossibleVirtualNetworkGatewaySKUTierValues() []VirtualNetworkGatewaySKUTier { + return []VirtualNetworkGatewaySKUTier{ + VirtualNetworkGatewaySKUTierBasic, + VirtualNetworkGatewaySKUTierErGw1AZ, + VirtualNetworkGatewaySKUTierErGw2AZ, + VirtualNetworkGatewaySKUTierErGw3AZ, + VirtualNetworkGatewaySKUTierHighPerformance, + VirtualNetworkGatewaySKUTierStandard, + VirtualNetworkGatewaySKUTierUltraPerformance, + VirtualNetworkGatewaySKUTierVPNGw1, + VirtualNetworkGatewaySKUTierVPNGw1AZ, + VirtualNetworkGatewaySKUTierVPNGw2, + VirtualNetworkGatewaySKUTierVPNGw2AZ, + VirtualNetworkGatewaySKUTierVPNGw3, + VirtualNetworkGatewaySKUTierVPNGw3AZ, + VirtualNetworkGatewaySKUTierVPNGw4, + VirtualNetworkGatewaySKUTierVPNGw4AZ, + VirtualNetworkGatewaySKUTierVPNGw5, + VirtualNetworkGatewaySKUTierVPNGw5AZ, + } +} + +// VirtualNetworkGatewayType - The type of this virtual network gateway. +type VirtualNetworkGatewayType string + +const ( + VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" + VirtualNetworkGatewayTypeVPN VirtualNetworkGatewayType = "Vpn" +) + +// PossibleVirtualNetworkGatewayTypeValues returns the possible values for the VirtualNetworkGatewayType const type. +func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { + return []VirtualNetworkGatewayType{ + VirtualNetworkGatewayTypeExpressRoute, + VirtualNetworkGatewayTypeLocalGateway, + VirtualNetworkGatewayTypeVPN, + } +} + +// VirtualNetworkPeeringLevel - The peering sync status of the virtual network peering. +type VirtualNetworkPeeringLevel string + +const ( + VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" + VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" + VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" + VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" +) + +// PossibleVirtualNetworkPeeringLevelValues returns the possible values for the VirtualNetworkPeeringLevel const type. +func PossibleVirtualNetworkPeeringLevelValues() []VirtualNetworkPeeringLevel { + return []VirtualNetworkPeeringLevel{ + VirtualNetworkPeeringLevelFullyInSync, + VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, + VirtualNetworkPeeringLevelLocalNotInSync, + VirtualNetworkPeeringLevelRemoteNotInSync, + } +} + +// VirtualNetworkPeeringState - The status of the virtual network peering. +type VirtualNetworkPeeringState string + +const ( + VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" + VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" +) + +// PossibleVirtualNetworkPeeringStateValues returns the possible values for the VirtualNetworkPeeringState const type. +func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { + return []VirtualNetworkPeeringState{ + VirtualNetworkPeeringStateConnected, + VirtualNetworkPeeringStateDisconnected, + VirtualNetworkPeeringStateInitiated, + } +} + +// VirtualNetworkPrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +// PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateEndpointNetworkPolicies const type. +func PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetworkPrivateEndpointNetworkPolicies { + return []VirtualNetworkPrivateEndpointNetworkPolicies{ + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } +} + +// VirtualNetworkPrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the +// subnet. +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +// PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues returns the possible values for the VirtualNetworkPrivateLinkServiceNetworkPolicies const type. +func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNetworkPrivateLinkServiceNetworkPolicies { + return []VirtualNetworkPrivateLinkServiceNetworkPolicies{ + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } +} + +// VirtualWanSecurityProviderType - The virtual wan security provider type. +type VirtualWanSecurityProviderType string + +const ( + VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" + VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" +) + +// PossibleVirtualWanSecurityProviderTypeValues returns the possible values for the VirtualWanSecurityProviderType const type. +func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { + return []VirtualWanSecurityProviderType{ + VirtualWanSecurityProviderTypeExternal, + VirtualWanSecurityProviderTypeNative, + } +} + +// VnetLocalRouteOverrideCriteria - Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination +// in spoke vnet. +type VnetLocalRouteOverrideCriteria string + +const ( + VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" + VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" +) + +// PossibleVnetLocalRouteOverrideCriteriaValues returns the possible values for the VnetLocalRouteOverrideCriteria const type. +func PossibleVnetLocalRouteOverrideCriteriaValues() []VnetLocalRouteOverrideCriteria { + return []VnetLocalRouteOverrideCriteria{ + VnetLocalRouteOverrideCriteriaContains, + VnetLocalRouteOverrideCriteriaEqual, + } +} + +// WebApplicationFirewallAction - Type of Actions. +type WebApplicationFirewallAction string + +const ( + WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" + WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" + WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" +) + +// PossibleWebApplicationFirewallActionValues returns the possible values for the WebApplicationFirewallAction const type. +func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { + return []WebApplicationFirewallAction{ + WebApplicationFirewallActionAllow, + WebApplicationFirewallActionBlock, + WebApplicationFirewallActionLog, + } +} + +// WebApplicationFirewallEnabledState - The state of the policy. +type WebApplicationFirewallEnabledState string + +const ( + WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" + WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" +) + +// PossibleWebApplicationFirewallEnabledStateValues returns the possible values for the WebApplicationFirewallEnabledState const type. +func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { + return []WebApplicationFirewallEnabledState{ + WebApplicationFirewallEnabledStateDisabled, + WebApplicationFirewallEnabledStateEnabled, + } +} + +// WebApplicationFirewallMatchVariable - Match Variable. +type WebApplicationFirewallMatchVariable string + +const ( + WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" + WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" + WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" + WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" +) + +// PossibleWebApplicationFirewallMatchVariableValues returns the possible values for the WebApplicationFirewallMatchVariable const type. +func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { + return []WebApplicationFirewallMatchVariable{ + WebApplicationFirewallMatchVariablePostArgs, + WebApplicationFirewallMatchVariableQueryString, + WebApplicationFirewallMatchVariableRemoteAddr, + WebApplicationFirewallMatchVariableRequestBody, + WebApplicationFirewallMatchVariableRequestCookies, + WebApplicationFirewallMatchVariableRequestHeaders, + WebApplicationFirewallMatchVariableRequestMethod, + WebApplicationFirewallMatchVariableRequestURI, + } +} + +// WebApplicationFirewallMode - The mode of the policy. +type WebApplicationFirewallMode string + +const ( + WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" +) + +// PossibleWebApplicationFirewallModeValues returns the possible values for the WebApplicationFirewallMode const type. +func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { + return []WebApplicationFirewallMode{ + WebApplicationFirewallModeDetection, + WebApplicationFirewallModePrevention, + } +} + +// WebApplicationFirewallOperator - The operator to be matched. +type WebApplicationFirewallOperator string + +const ( + WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" + WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" + WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" + WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" + WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" + WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" + WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" + WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" + WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" + WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" + WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" +) + +// PossibleWebApplicationFirewallOperatorValues returns the possible values for the WebApplicationFirewallOperator const type. +func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { + return []WebApplicationFirewallOperator{ + WebApplicationFirewallOperatorAny, + WebApplicationFirewallOperatorBeginsWith, + WebApplicationFirewallOperatorContains, + WebApplicationFirewallOperatorEndsWith, + WebApplicationFirewallOperatorEqual, + WebApplicationFirewallOperatorGeoMatch, + WebApplicationFirewallOperatorGreaterThan, + WebApplicationFirewallOperatorGreaterThanOrEqual, + WebApplicationFirewallOperatorIPMatch, + WebApplicationFirewallOperatorLessThan, + WebApplicationFirewallOperatorLessThanOrEqual, + WebApplicationFirewallOperatorRegex, + } +} + +// WebApplicationFirewallPolicyResourceState - Resource status of the policy. +type WebApplicationFirewallPolicyResourceState string + +const ( + WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" + WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" + WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" + WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" + WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" +) + +// PossibleWebApplicationFirewallPolicyResourceStateValues returns the possible values for the WebApplicationFirewallPolicyResourceState const type. +func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { + return []WebApplicationFirewallPolicyResourceState{ + WebApplicationFirewallPolicyResourceStateCreating, + WebApplicationFirewallPolicyResourceStateDeleting, + WebApplicationFirewallPolicyResourceStateDisabled, + WebApplicationFirewallPolicyResourceStateDisabling, + WebApplicationFirewallPolicyResourceStateEnabled, + WebApplicationFirewallPolicyResourceStateEnabling, + } +} + +// WebApplicationFirewallRuleType - The rule type. +type WebApplicationFirewallRuleType string + +const ( + WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" + WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" +) + +// PossibleWebApplicationFirewallRuleTypeValues returns the possible values for the WebApplicationFirewallRuleType const type. +func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { + return []WebApplicationFirewallRuleType{ + WebApplicationFirewallRuleTypeInvalid, + WebApplicationFirewallRuleTypeMatchRule, + } +} + +// WebApplicationFirewallState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not +// specified. +type WebApplicationFirewallState string + +const ( + WebApplicationFirewallStateDisabled WebApplicationFirewallState = "Disabled" + WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" +) + +// PossibleWebApplicationFirewallStateValues returns the possible values for the WebApplicationFirewallState const type. +func PossibleWebApplicationFirewallStateValues() []WebApplicationFirewallState { + return []WebApplicationFirewallState{ + WebApplicationFirewallStateDisabled, + WebApplicationFirewallStateEnabled, + } +} + +// WebApplicationFirewallTransform - Transforms applied before matching. +type WebApplicationFirewallTransform string + +const ( + WebApplicationFirewallTransformHTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" + WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" + WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" +) + +// PossibleWebApplicationFirewallTransformValues returns the possible values for the WebApplicationFirewallTransform const type. +func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { + return []WebApplicationFirewallTransform{ + WebApplicationFirewallTransformHTMLEntityDecode, + WebApplicationFirewallTransformLowercase, + WebApplicationFirewallTransformRemoveNulls, + WebApplicationFirewallTransformTrim, + WebApplicationFirewallTransformURLDecode, + WebApplicationFirewallTransformURLEncode, + WebApplicationFirewallTransformUppercase, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/customipprefixes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/customipprefixes_client.go new file mode 100644 index 00000000000..bc379720b89 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/customipprefixes_client.go @@ -0,0 +1,425 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// CustomIPPrefixesClient contains the methods for the CustomIPPrefixes group. +// Don't use this type directly, use NewCustomIPPrefixesClient() instead. +type CustomIPPrefixesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCustomIPPrefixesClient creates a new instance of CustomIPPrefixesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCustomIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomIPPrefixesClient, error) { + cl, err := arm.NewClient(moduleName+".CustomIPPrefixesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CustomIPPrefixesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a custom IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - customIPPrefixName - The name of the custom IP prefix. +// - parameters - Parameters supplied to the create or update custom IP prefix operation. +// - options - CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate +// method. +func (client *CustomIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomIPPrefixesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, customIPPrefixName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomIPPrefixesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[CustomIPPrefixesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a custom IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *CustomIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, customIPPrefixName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if customIPPrefixName == "" { + return nil, errors.New("parameter customIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified custom IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - customIPPrefixName - The name of the CustomIpPrefix. +// - options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete +// method. +func (client *CustomIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[CustomIPPrefixesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, customIPPrefixName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomIPPrefixesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[CustomIPPrefixesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified custom IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, customIPPrefixName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if customIPPrefixName == "" { + return nil, errors.New("parameter customIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified custom IP prefix in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - customIPPrefixName - The name of the custom IP prefix. +// - options - CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. +func (client *CustomIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (CustomIPPrefixesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, customIPPrefixName, options) + if err != nil { + return CustomIPPrefixesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomIPPrefixesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomIPPrefixesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if customIPPrefixName == "" { + return nil, errors.New("parameter customIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (CustomIPPrefixesClientGetResponse, error) { + result := CustomIPPrefixesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefix); err != nil { + return CustomIPPrefixesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all custom IP prefixes in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager +// method. +func (client *CustomIPPrefixesClient) NewListPager(resourceGroupName string, options *CustomIPPrefixesClientListOptions) *runtime.Pager[CustomIPPrefixesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CustomIPPrefixesClientListResponse]{ + More: func(page CustomIPPrefixesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CustomIPPrefixesClientListResponse) (CustomIPPrefixesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CustomIPPrefixesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomIPPrefixesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomIPPrefixesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CustomIPPrefixesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (CustomIPPrefixesClientListResponse, error) { + result := CustomIPPrefixesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefixListResult); err != nil { + return CustomIPPrefixesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the custom IP prefixes in a subscription. +// +// Generated from API version 2022-09-01 +// - options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager +// method. +func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[CustomIPPrefixesClientListAllResponse]{ + More: func(page CustomIPPrefixesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CustomIPPrefixesClientListAllResponse) (CustomIPPrefixesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CustomIPPrefixesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomIPPrefixesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomIPPrefixesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *CustomIPPrefixesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *CustomIPPrefixesClient) listAllHandleResponse(resp *http.Response) (CustomIPPrefixesClientListAllResponse, error) { + result := CustomIPPrefixesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefixListResult); err != nil { + return CustomIPPrefixesClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates custom IP prefix tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - customIPPrefixName - The name of the custom IP prefix. +// - parameters - Parameters supplied to update custom IP prefix tags. +// - options - CustomIPPrefixesClientUpdateTagsOptions contains the optional parameters for the CustomIPPrefixesClient.UpdateTags +// method. +func (client *CustomIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject, options *CustomIPPrefixesClientUpdateTagsOptions) (CustomIPPrefixesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, customIPPrefixName, parameters, options) + if err != nil { + return CustomIPPrefixesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomIPPrefixesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomIPPrefixesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject, options *CustomIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if customIPPrefixName == "" { + return nil, errors.New("parameter customIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customIpPrefixName}", url.PathEscape(customIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *CustomIPPrefixesClient) updateTagsHandleResponse(resp *http.Response) (CustomIPPrefixesClientUpdateTagsResponse, error) { + result := CustomIPPrefixesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomIPPrefix); err != nil { + return CustomIPPrefixesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddoscustompolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddoscustompolicies_client.go new file mode 100644 index 00000000000..7c237262eb4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddoscustompolicies_client.go @@ -0,0 +1,297 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// DdosCustomPoliciesClient contains the methods for the DdosCustomPolicies group. +// Don't use this type directly, use NewDdosCustomPoliciesClient() instead. +type DdosCustomPoliciesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDdosCustomPoliciesClient creates a new instance of DdosCustomPoliciesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDdosCustomPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosCustomPoliciesClient, error) { + cl, err := arm.NewClient(moduleName+".DdosCustomPoliciesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DdosCustomPoliciesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a DDoS custom policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosCustomPolicyName - The name of the DDoS custom policy. +// - parameters - Parameters supplied to the create or update operation. +// - options - DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate +// method. +func (client *DdosCustomPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DdosCustomPoliciesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosCustomPoliciesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[DdosCustomPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a DDoS custom policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DdosCustomPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosCustomPolicyName == "" { + return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified DDoS custom policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosCustomPolicyName - The name of the DDoS custom policy. +// - options - DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete +// method. +func (client *DdosCustomPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*runtime.Poller[DdosCustomPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, ddosCustomPolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosCustomPoliciesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DdosCustomPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified DDoS custom policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosCustomPolicyName == "" { + return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified DDoS custom policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosCustomPolicyName - The name of the DDoS custom policy. +// - options - DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. +func (client *DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (DdosCustomPoliciesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, options) + if err != nil { + return DdosCustomPoliciesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosCustomPoliciesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosCustomPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosCustomPolicyName == "" { + return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DdosCustomPoliciesClient) getHandleResponse(resp *http.Response) (DdosCustomPoliciesClientGetResponse, error) { + result := DdosCustomPoliciesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicy); err != nil { + return DdosCustomPoliciesClientGetResponse{}, err + } + return result, nil +} + +// UpdateTags - Update a DDoS custom policy tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosCustomPolicyName - The name of the DDoS custom policy. +// - parameters - Parameters supplied to update DDoS custom policy resource tags. +// - options - DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags +// method. +func (client *DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject, options *DdosCustomPoliciesClientUpdateTagsOptions) (DdosCustomPoliciesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ddosCustomPolicyName, parameters, options) + if err != nil { + return DdosCustomPoliciesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosCustomPoliciesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosCustomPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject, options *DdosCustomPoliciesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosCustomPolicyName == "" { + return nil, errors.New("parameter ddosCustomPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosCustomPolicyName}", url.PathEscape(ddosCustomPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *DdosCustomPoliciesClient) updateTagsHandleResponse(resp *http.Response) (DdosCustomPoliciesClientUpdateTagsResponse, error) { + result := DdosCustomPoliciesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosCustomPolicy); err != nil { + return DdosCustomPoliciesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddosprotectionplans_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddosprotectionplans_client.go new file mode 100644 index 00000000000..d85735dbd2d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ddosprotectionplans_client.go @@ -0,0 +1,422 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// DdosProtectionPlansClient contains the methods for the DdosProtectionPlans group. +// Don't use this type directly, use NewDdosProtectionPlansClient() instead. +type DdosProtectionPlansClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDdosProtectionPlansClient creates a new instance of DdosProtectionPlansClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDdosProtectionPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DdosProtectionPlansClient, error) { + cl, err := arm.NewClient(moduleName+".DdosProtectionPlansClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DdosProtectionPlansClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a DDoS protection plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosProtectionPlanName - The name of the DDoS protection plan. +// - parameters - Parameters supplied to the create or update operation. +// - options - DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate +// method. +func (client *DdosProtectionPlansClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*runtime.Poller[DdosProtectionPlansClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosProtectionPlansClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[DdosProtectionPlansClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a DDoS protection plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DdosProtectionPlansClient) createOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosProtectionPlanName == "" { + return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified DDoS protection plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosProtectionPlanName - The name of the DDoS protection plan. +// - options - DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete +// method. +func (client *DdosProtectionPlansClient) BeginDelete(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*runtime.Poller[DdosProtectionPlansClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, ddosProtectionPlanName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DdosProtectionPlansClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DdosProtectionPlansClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified DDoS protection plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosProtectionPlanName == "" { + return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified DDoS protection plan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosProtectionPlanName - The name of the DDoS protection plan. +// - options - DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. +func (client *DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (DdosProtectionPlansClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, options) + if err != nil { + return DdosProtectionPlansClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosProtectionPlansClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosProtectionPlansClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosProtectionPlanName == "" { + return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) (DdosProtectionPlansClientGetResponse, error) { + result := DdosProtectionPlansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlan); err != nil { + return DdosProtectionPlansClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all DDoS protection plans in a subscription. +// +// Generated from API version 2022-09-01 +// - options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager +// method. +func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DdosProtectionPlansClientListResponse]{ + More: func(page DdosProtectionPlansClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DdosProtectionPlansClientListResponse) (DdosProtectionPlansClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DdosProtectionPlansClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosProtectionPlansClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosProtectionPlansClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, options *DdosProtectionPlansClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) (DdosProtectionPlansClientListResponse, error) { + result := DdosProtectionPlansClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlanListResult); err != nil { + return DdosProtectionPlansClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager +// method. +func (client *DdosProtectionPlansClient) NewListByResourceGroupPager(resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) *runtime.Pager[DdosProtectionPlansClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[DdosProtectionPlansClientListByResourceGroupResponse]{ + More: func(page DdosProtectionPlansClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DdosProtectionPlansClientListByResourceGroupResponse) (DdosProtectionPlansClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DdosProtectionPlansClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosProtectionPlansClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosProtectionPlansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *DdosProtectionPlansClient) listByResourceGroupHandleResponse(resp *http.Response) (DdosProtectionPlansClientListByResourceGroupResponse, error) { + result := DdosProtectionPlansClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlanListResult); err != nil { + return DdosProtectionPlansClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Update a DDoS protection plan tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ddosProtectionPlanName - The name of the DDoS protection plan. +// - parameters - Parameters supplied to the update DDoS protection plan resource tags. +// - options - DdosProtectionPlansClientUpdateTagsOptions contains the optional parameters for the DdosProtectionPlansClient.UpdateTags +// method. +func (client *DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject, options *DdosProtectionPlansClientUpdateTagsOptions) (DdosProtectionPlansClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ddosProtectionPlanName, parameters, options) + if err != nil { + return DdosProtectionPlansClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DdosProtectionPlansClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DdosProtectionPlansClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject, options *DdosProtectionPlansClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ddosProtectionPlanName == "" { + return nil, errors.New("parameter ddosProtectionPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ddosProtectionPlanName}", url.PathEscape(ddosProtectionPlanName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *DdosProtectionPlansClient) updateTagsHandleResponse(resp *http.Response) (DdosProtectionPlansClientUpdateTagsResponse, error) { + result := DdosProtectionPlansClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DdosProtectionPlan); err != nil { + return DdosProtectionPlansClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/defaultsecurityrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/defaultsecurityrules_client.go new file mode 100644 index 00000000000..d29988e29b4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/defaultsecurityrules_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// DefaultSecurityRulesClient contains the methods for the DefaultSecurityRules group. +// Don't use this type directly, use NewDefaultSecurityRulesClient() instead. +type DefaultSecurityRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDefaultSecurityRulesClient creates a new instance of DefaultSecurityRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDefaultSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DefaultSecurityRulesClient, error) { + cl, err := arm.NewClient(moduleName+".DefaultSecurityRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DefaultSecurityRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get the specified default network security rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - defaultSecurityRuleName - The name of the default security rule. +// - options - DefaultSecurityRulesClientGetOptions contains the optional parameters for the DefaultSecurityRulesClient.Get +// method. +func (client *DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string, options *DefaultSecurityRulesClientGetOptions) (DefaultSecurityRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options) + if err != nil { + return DefaultSecurityRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefaultSecurityRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DefaultSecurityRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string, options *DefaultSecurityRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + if defaultSecurityRuleName == "" { + return nil, errors.New("parameter defaultSecurityRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{defaultSecurityRuleName}", url.PathEscape(defaultSecurityRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DefaultSecurityRulesClient) getHandleResponse(resp *http.Response) (DefaultSecurityRulesClientGetResponse, error) { + result := DefaultSecurityRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRule); err != nil { + return DefaultSecurityRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all default security rules in a network security group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - options - DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.NewListPager +// method. +func (client *DefaultSecurityRulesClient) NewListPager(resourceGroupName string, networkSecurityGroupName string, options *DefaultSecurityRulesClientListOptions) *runtime.Pager[DefaultSecurityRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DefaultSecurityRulesClientListResponse]{ + More: func(page DefaultSecurityRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DefaultSecurityRulesClientListResponse) (DefaultSecurityRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DefaultSecurityRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefaultSecurityRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DefaultSecurityRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *DefaultSecurityRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DefaultSecurityRulesClient) listHandleResponse(resp *http.Response) (DefaultSecurityRulesClientListResponse, error) { + result := DefaultSecurityRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRuleListResult); err != nil { + return DefaultSecurityRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/dscpconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/dscpconfiguration_client.go new file mode 100644 index 00000000000..399a7a8c8bb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/dscpconfiguration_client.go @@ -0,0 +1,363 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// DscpConfigurationClient contains the methods for the DscpConfiguration group. +// Don't use this type directly, use NewDscpConfigurationClient() instead. +type DscpConfigurationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDscpConfigurationClient creates a new instance of DscpConfigurationClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDscpConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DscpConfigurationClient, error) { + cl, err := arm.NewClient(moduleName+".DscpConfigurationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DscpConfigurationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a DSCP Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - dscpConfigurationName - The name of the resource. +// - parameters - Parameters supplied to the create or update dscp configuration operation. +// - options - DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate +// method. +func (client *DscpConfigurationClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*runtime.Poller[DscpConfigurationClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, dscpConfigurationName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DscpConfigurationClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DscpConfigurationClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a DSCP Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DscpConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dscpConfigurationName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if dscpConfigurationName == "" { + return nil, errors.New("parameter dscpConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes a DSCP Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - dscpConfigurationName - The name of the resource. +// - options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete +// method. +func (client *DscpConfigurationClient) BeginDelete(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*runtime.Poller[DscpConfigurationClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, dscpConfigurationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DscpConfigurationClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DscpConfigurationClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a DSCP Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, dscpConfigurationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if dscpConfigurationName == "" { + return nil, errors.New("parameter dscpConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a DSCP Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - dscpConfigurationName - The name of the resource. +// - options - DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. +func (client *DscpConfigurationClient) Get(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (DscpConfigurationClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, dscpConfigurationName, options) + if err != nil { + return DscpConfigurationClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DscpConfigurationClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DscpConfigurationClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if dscpConfigurationName == "" { + return nil, errors.New("parameter dscpConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dscpConfigurationName}", url.PathEscape(dscpConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (DscpConfigurationClientGetResponse, error) { + result := DscpConfigurationClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfiguration); err != nil { + return DscpConfigurationClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a DSCP Configuration. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager +// method. +func (client *DscpConfigurationClient) NewListPager(resourceGroupName string, options *DscpConfigurationClientListOptions) *runtime.Pager[DscpConfigurationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DscpConfigurationClientListResponse]{ + More: func(page DscpConfigurationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DscpConfigurationClientListResponse) (DscpConfigurationClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DscpConfigurationClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DscpConfigurationClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DscpConfigurationClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *DscpConfigurationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) (DscpConfigurationClientListResponse, error) { + result := DscpConfigurationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfigurationListResult); err != nil { + return DscpConfigurationClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all dscp configurations in a subscription. +// +// Generated from API version 2022-09-01 +// - options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager +// method. +func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[DscpConfigurationClientListAllResponse]{ + More: func(page DscpConfigurationClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DscpConfigurationClientListAllResponse) (DscpConfigurationClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DscpConfigurationClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DscpConfigurationClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DscpConfigurationClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, options *DscpConfigurationClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *DscpConfigurationClient) listAllHandleResponse(resp *http.Response) (DscpConfigurationClientListAllResponse, error) { + result := DscpConfigurationClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DscpConfigurationListResult); err != nil { + return DscpConfigurationClientListAllResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitauthorizations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitauthorizations_client.go new file mode 100644 index 00000000000..ce42f8729a2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitauthorizations_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCircuitAuthorizationsClient contains the methods for the ExpressRouteCircuitAuthorizations group. +// Don't use this type directly, use NewExpressRouteCircuitAuthorizationsClient() instead. +type ExpressRouteCircuitAuthorizationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCircuitAuthorizationsClient creates a new instance of ExpressRouteCircuitAuthorizationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitAuthorizationsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCircuitAuthorizationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCircuitAuthorizationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an authorization in the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - authorizationName - The name of the authorization. +// - authorizationParameters - Parameters supplied to the create or update express route circuit authorization operation. +// - options - ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteCircuitAuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an authorization in the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, authorizationParameters) +} + +// BeginDelete - Deletes the specified authorization from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - authorizationName - The name of the authorization. +// - options - ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete +// method. +func (client *ExpressRouteCircuitAuthorizationsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitAuthorizationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, authorizationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitAuthorizationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitAuthorizationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified authorization from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified authorization from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - authorizationName - The name of the authorization. +// - options - ExpressRouteCircuitAuthorizationsClientGetOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.Get +// method. +func (client *ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientGetOptions) (ExpressRouteCircuitAuthorizationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, authorizationName, options) + if err != nil { + return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitAuthorizationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitAuthorizationsClientGetResponse, error) { + result := ExpressRouteCircuitAuthorizationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitAuthorization); err != nil { + return ExpressRouteCircuitAuthorizationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all authorizations in an express route circuit. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the circuit. +// - options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager +// method. +func (client *ExpressRouteCircuitAuthorizationsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) *runtime.Pager[ExpressRouteCircuitAuthorizationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitAuthorizationsClientListResponse]{ + More: func(page ExpressRouteCircuitAuthorizationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCircuitAuthorizationsClientListResponse) (ExpressRouteCircuitAuthorizationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCircuitAuthorizationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitAuthorizationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitAuthorizationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCircuitAuthorizationsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitAuthorizationsClientListResponse, error) { + result := ExpressRouteCircuitAuthorizationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationListResult); err != nil { + return ExpressRouteCircuitAuthorizationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitconnections_client.go new file mode 100644 index 00000000000..39fc5921728 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitconnections_client.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCircuitConnectionsClient contains the methods for the ExpressRouteCircuitConnections group. +// Don't use this type directly, use NewExpressRouteCircuitConnectionsClient() instead. +type ExpressRouteCircuitConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCircuitConnectionsClient creates a new instance of ExpressRouteCircuitConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCircuitConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCircuitConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - connectionName - The name of the express route circuit connection. +// - expressRouteCircuitConnectionParameters - Parameters supplied to the create or update express route circuit connection +// operation. +// - options - ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteCircuitConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a Express Route Circuit Connection in the specified express route circuits. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters) +} + +// BeginDelete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - connectionName - The name of the express route circuit connection. +// - options - ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete +// method. +func (client *ExpressRouteCircuitConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Express Route Circuit Connection from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Express Route Circuit Connection from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - connectionName - The name of the express route circuit connection. +// - options - ExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.Get +// method. +func (client *ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientGetOptions) (ExpressRouteCircuitConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) + if err != nil { + return ExpressRouteCircuitConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *ExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitConnectionsClientGetResponse, error) { + result := ExpressRouteCircuitConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitConnection); err != nil { + return ExpressRouteCircuitConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all global reach connections associated with a private peering in an express route circuit. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the circuit. +// - peeringName - The name of the peering. +// - options - ExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.NewListPager +// method. +func (client *ExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitConnectionsClientListOptions) *runtime.Pager[ExpressRouteCircuitConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitConnectionsClientListResponse]{ + More: func(page ExpressRouteCircuitConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCircuitConnectionsClientListResponse) (ExpressRouteCircuitConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCircuitConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCircuitConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitConnectionsClientListResponse, error) { + result := ExpressRouteCircuitConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitConnectionListResult); err != nil { + return ExpressRouteCircuitConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitpeerings_client.go new file mode 100644 index 00000000000..915899eaa66 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuitpeerings_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCircuitPeeringsClient contains the methods for the ExpressRouteCircuitPeerings group. +// Don't use this type directly, use NewExpressRouteCircuitPeeringsClient() instead. +type ExpressRouteCircuitPeeringsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCircuitPeeringsClient creates a new instance of ExpressRouteCircuitPeeringsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCircuitPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitPeeringsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCircuitPeeringsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCircuitPeeringsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a peering in the specified express route circuits. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - peeringParameters - Parameters supplied to the create or update express route circuit peering operation. +// - options - ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteCircuitPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, peeringName, peeringParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a peering in the specified express route circuits. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, peeringName, peeringParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, peeringParameters) +} + +// BeginDelete - Deletes the specified peering from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - options - ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete +// method. +func (client *ExpressRouteCircuitPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitPeeringsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, peeringName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitPeeringsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitPeeringsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified peering from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified peering for the express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - options - ExpressRouteCircuitPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.Get +// method. +func (client *ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientGetOptions) (ExpressRouteCircuitPeeringsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) + if err != nil { + return ExpressRouteCircuitPeeringsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitPeeringsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitPeeringsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitPeeringsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitPeeringsClientGetResponse, error) { + result := ExpressRouteCircuitPeeringsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitPeering); err != nil { + return ExpressRouteCircuitPeeringsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all peerings in a specified express route circuit. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - options - ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.NewListPager +// method. +func (client *ExpressRouteCircuitPeeringsClient) NewListPager(resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) *runtime.Pager[ExpressRouteCircuitPeeringsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitPeeringsClientListResponse]{ + More: func(page ExpressRouteCircuitPeeringsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCircuitPeeringsClientListResponse) (ExpressRouteCircuitPeeringsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCircuitPeeringsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitPeeringsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitPeeringsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCircuitPeeringsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitPeeringsClientListResponse, error) { + result := ExpressRouteCircuitPeeringsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitPeeringListResult); err != nil { + return ExpressRouteCircuitPeeringsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuits_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuits_client.go new file mode 100644 index 00000000000..331207e1813 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecircuits_client.go @@ -0,0 +1,778 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCircuitsClient contains the methods for the ExpressRouteCircuits group. +// Don't use this type directly, use NewExpressRouteCircuitsClient() instead. +type ExpressRouteCircuitsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCircuitsClient creates a new instance of ExpressRouteCircuitsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCircuitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCircuitsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCircuitsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCircuitsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the circuit. +// - parameters - Parameters supplied to the create or update express route circuit operation. +// - options - ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteCircuitsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCircuitsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, circuitName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitsClient) createOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, circuitName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - options - ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete +// method. +func (client *ExpressRouteCircuitsClient) BeginDelete(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCircuitsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, circuitName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, circuitName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of express route circuit. +// - options - ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get +// method. +func (client *ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetOptions) (ExpressRouteCircuitsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, options) + if err != nil { + return ExpressRouteCircuitsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCircuitsClient) getHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetResponse, error) { + result := ExpressRouteCircuitsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuit); err != nil { + return ExpressRouteCircuitsClientGetResponse{}, err + } + return result, nil +} + +// GetPeeringStats - Gets all stats from an express route circuit in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - options - ExpressRouteCircuitsClientGetPeeringStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetPeeringStats +// method. +func (client *ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitsClientGetPeeringStatsOptions) (ExpressRouteCircuitsClientGetPeeringStatsResponse, error) { + req, err := client.getPeeringStatsCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) + if err != nil { + return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, runtime.NewResponseError(resp) + } + return client.getPeeringStatsHandleResponse(resp) +} + +// getPeeringStatsCreateRequest creates the GetPeeringStats request. +func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitsClientGetPeeringStatsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getPeeringStatsHandleResponse handles the GetPeeringStats response. +func (client *ExpressRouteCircuitsClient) getPeeringStatsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetPeeringStatsResponse, error) { + result := ExpressRouteCircuitsClientGetPeeringStatsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitStats); err != nil { + return ExpressRouteCircuitsClientGetPeeringStatsResponse{}, err + } + return result, nil +} + +// GetStats - Gets all the stats from an express route circuit in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - options - ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats +// method. +func (client *ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (ExpressRouteCircuitsClientGetStatsResponse, error) { + req, err := client.getStatsCreateRequest(ctx, resourceGroupName, circuitName, options) + if err != nil { + return ExpressRouteCircuitsClientGetStatsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientGetStatsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientGetStatsResponse{}, runtime.NewResponseError(resp) + } + return client.getStatsHandleResponse(resp) +} + +// getStatsCreateRequest creates the GetStats request. +func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getStatsHandleResponse handles the GetStats response. +func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientGetStatsResponse, error) { + result := ExpressRouteCircuitsClientGetStatsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitStats); err != nil { + return ExpressRouteCircuitsClientGetStatsResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the express route circuits in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager +// method. +func (client *ExpressRouteCircuitsClient) NewListPager(resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) *runtime.Pager[ExpressRouteCircuitsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitsClientListResponse]{ + More: func(page ExpressRouteCircuitsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCircuitsClientListResponse) (ExpressRouteCircuitsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCircuitsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientListResponse, error) { + result := ExpressRouteCircuitsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitListResult); err != nil { + return ExpressRouteCircuitsClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the express route circuits in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager +// method. +func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCircuitsClientListAllResponse]{ + More: func(page ExpressRouteCircuitsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCircuitsClientListAllResponse) (ExpressRouteCircuitsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCircuitsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Context, options *ExpressRouteCircuitsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *ExpressRouteCircuitsClient) listAllHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientListAllResponse, error) { + result := ExpressRouteCircuitsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuitListResult); err != nil { + return ExpressRouteCircuitsClientListAllResponse{}, err + } + return result, nil +} + +// BeginListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable +// method. +func (client *ExpressRouteCircuitsClient) BeginListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListArpTableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listArpTable(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListArpTableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListArpTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListArpTable - Gets the currently advertised ARP table associated with the express route circuit in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitsClient) listArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*http.Response, error) { + req, err := client.listArpTableCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listArpTableCreateRequest creates the ListArpTable request. +func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable +// method. +func (client *ExpressRouteCircuitsClient) BeginListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listRoutesTable(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListRoutesTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListRoutesTable - Gets the currently advertised routes table associated with the express route circuit in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitsClient) listRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*http.Response, error) { + req, err := client.listRoutesTableCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listRoutesTableCreateRequest creates the ListRoutesTable request. +func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit +// in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary +// method. +func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*runtime.Poller[ExpressRouteCircuitsClientListRoutesTableSummaryResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listRoutesTableSummary(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCircuitsClientListRoutesTableSummaryResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCircuitsClientListRoutesTableSummaryResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListRoutesTableSummary - Gets the currently advertised routes table summary associated with the express route circuit in +// a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCircuitsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { + req, err := client.listRoutesTableSummaryCreateRequest(ctx, resourceGroupName, circuitName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. +func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// UpdateTags - Updates an express route circuit tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the circuit. +// - parameters - Parameters supplied to update express route circuit tags. +// - options - ExpressRouteCircuitsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCircuitsClient.UpdateTags +// method. +func (client *ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject, options *ExpressRouteCircuitsClientUpdateTagsOptions) (ExpressRouteCircuitsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, circuitName, parameters, options) + if err != nil { + return ExpressRouteCircuitsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCircuitsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCircuitsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject, options *ExpressRouteCircuitsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ExpressRouteCircuitsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRouteCircuitsClientUpdateTagsResponse, error) { + result := ExpressRouteCircuitsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCircuit); err != nil { + return ExpressRouteCircuitsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteconnections_client.go new file mode 100644 index 00000000000..a206732f280 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteconnections_client.go @@ -0,0 +1,312 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteConnectionsClient contains the methods for the ExpressRouteConnections group. +// Don't use this type directly, use NewExpressRouteConnectionsClient() instead. +type ExpressRouteConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteConnectionsClient creates a new instance of ExpressRouteConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - connectionName - The name of the connection subresource. +// - putExpressRouteConnectionParameters - Parameters required in an ExpressRouteConnection PUT operation. +// - options - ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters) +} + +// BeginDelete - Deletes a connection to a ExpressRoute circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - connectionName - The name of the connection subresource. +// - options - ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete +// method. +func (client *ExpressRouteConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a connection to a ExpressRoute circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified ExpressRouteConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - connectionName - The name of the ExpressRoute connection. +// - options - ExpressRouteConnectionsClientGetOptions contains the optional parameters for the ExpressRouteConnectionsClient.Get +// method. +func (client *ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientGetOptions) (ExpressRouteConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, connectionName, options) + if err != nil { + return ExpressRouteConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, options *ExpressRouteConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteConnectionsClientGetResponse, error) { + result := ExpressRouteConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteConnection); err != nil { + return ExpressRouteConnectionsClientGetResponse{}, err + } + return result, nil +} + +// List - Lists ExpressRouteConnections. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List +// method. +func (client *ExpressRouteConnectionsClient) List(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteConnectionsClientListOptions) (ExpressRouteConnectionsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return ExpressRouteConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteConnectionsClientListResponse, error) { + result := ExpressRouteConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteConnectionList); err != nil { + return ExpressRouteConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnectionpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnectionpeerings_client.go new file mode 100644 index 00000000000..62638a0a2ef --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnectionpeerings_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCrossConnectionPeeringsClient contains the methods for the ExpressRouteCrossConnectionPeerings group. +// Don't use this type directly, use NewExpressRouteCrossConnectionPeeringsClient() instead. +type ExpressRouteCrossConnectionPeeringsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCrossConnectionPeeringsClient creates a new instance of ExpressRouteCrossConnectionPeeringsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionPeeringsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCrossConnectionPeeringsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCrossConnectionPeeringsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - peeringParameters - Parameters supplied to the create or update ExpressRouteCrossConnection peering operation. +// - options - ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate method. +func (client *ExpressRouteCrossConnectionPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a peering in the specified ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, peeringParameters) +} + +// BeginDelete - Deletes the specified peering from the ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - options - ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete +// method. +func (client *ExpressRouteCrossConnectionPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteCrossConnectionPeeringsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, crossConnectionName, peeringName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionPeeringsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionPeeringsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified peering from the ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified peering for the ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - options - ExpressRouteCrossConnectionPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.Get +// method. +func (client *ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientGetOptions) (ExpressRouteCrossConnectionPeeringsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, options) + if err != nil { + return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionPeeringsClientGetResponse, error) { + result := ExpressRouteCrossConnectionPeeringsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionPeering); err != nil { + return ExpressRouteCrossConnectionPeeringsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager +// method. +func (client *ExpressRouteCrossConnectionPeeringsClient) NewListPager(resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionPeeringsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionPeeringsClientListResponse]{ + More: func(page ExpressRouteCrossConnectionPeeringsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionPeeringsClientListResponse) (ExpressRouteCrossConnectionPeeringsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, crossConnectionName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionPeeringsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCrossConnectionPeeringsClient) listHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionPeeringsClientListResponse, error) { + result := ExpressRouteCrossConnectionPeeringsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionPeeringList); err != nil { + return ExpressRouteCrossConnectionPeeringsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnections_client.go new file mode 100644 index 00000000000..41eef028861 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutecrossconnections_client.go @@ -0,0 +1,593 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteCrossConnectionsClient contains the methods for the ExpressRouteCrossConnections group. +// Don't use this type directly, use NewExpressRouteCrossConnectionsClient() instead. +type ExpressRouteCrossConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteCrossConnectionsClient creates a new instance of ExpressRouteCrossConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteCrossConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteCrossConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteCrossConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteCrossConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Update the specified ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - parameters - Parameters supplied to the update express route crossConnection operation. +// - options - ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteCrossConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, crossConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Update the specified ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, crossConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets details about the specified ExpressRouteCrossConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group (peering location of the circuit). +// - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). +// - options - ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get +// method. +func (client *ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionsClientGetOptions) (ExpressRouteCrossConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, crossConnectionName, options) + if err != nil { + return ExpressRouteCrossConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientGetResponse, error) { + result := ExpressRouteCrossConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnection); err != nil { + return ExpressRouteCrossConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager +// method. +func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionsClientListResponse]{ + More: func(page ExpressRouteCrossConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionsClientListResponse) (ExpressRouteCrossConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCrossConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context.Context, options *ExpressRouteCrossConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientListResponse, error) { + result := ExpressRouteCrossConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionListResult); err != nil { + return ExpressRouteCrossConnectionsClientListResponse{}, err + } + return result, nil +} + +// BeginListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable +// method. +func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListArpTableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listArpTable(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListArpTableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListArpTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListArpTable - Gets the currently advertised ARP table associated with the express route cross connection in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionsClient) listArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*http.Response, error) { + req, err := client.listArpTableCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listArpTableCreateRequest creates the ListArpTable request. +func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager +// method. +func (client *ExpressRouteCrossConnectionsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteCrossConnectionsClientListByResourceGroupResponse]{ + More: func(page ExpressRouteCrossConnectionsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteCrossConnectionsClientListByResourceGroupResponse) (ExpressRouteCrossConnectionsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientListByResourceGroupResponse, error) { + result := ExpressRouteCrossConnectionsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnectionListResult); err != nil { + return ExpressRouteCrossConnectionsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// BeginListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in +// a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable +// method. +func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListRoutesTableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listRoutesTable(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListRoutesTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListRoutesTable - Gets the currently advertised routes table associated with the express route cross connection in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionsClient) listRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*http.Response, error) { + req, err := client.listRoutesTableCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listRoutesTableCreateRequest creates the ListRoutesTable request. +func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the ExpressRouteCrossConnection. +// - peeringName - The name of the peering. +// - devicePath - The path of the device. +// - options - ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the +// ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary method. +func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*runtime.Poller[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listRoutesTableSummary(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListRoutesTableSummary - Gets the route table summary associated with the express route cross connection in a resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*http.Response, error) { + req, err := client.listRoutesTableSummaryCreateRequest(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listRoutesTableSummaryCreateRequest creates the ListRoutesTableSummary request. +func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if devicePath == "" { + return nil, errors.New("parameter devicePath cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devicePath}", url.PathEscape(devicePath)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// UpdateTags - Updates an express route cross connection tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - crossConnectionName - The name of the cross connection. +// - crossConnectionParameters - Parameters supplied to update express route cross connection tags. +// - options - ExpressRouteCrossConnectionsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.UpdateTags +// method. +func (client *ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject, options *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (ExpressRouteCrossConnectionsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, crossConnectionName, crossConnectionParameters, options) + if err != nil { + return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject, options *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if crossConnectionName == "" { + return nil, errors.New("parameter crossConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{crossConnectionName}", url.PathEscape(crossConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, crossConnectionParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ExpressRouteCrossConnectionsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRouteCrossConnectionsClientUpdateTagsResponse, error) { + result := ExpressRouteCrossConnectionsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteCrossConnection); err != nil { + return ExpressRouteCrossConnectionsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutegateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutegateways_client.go new file mode 100644 index 00000000000..923a8319717 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutegateways_client.go @@ -0,0 +1,410 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteGatewaysClient contains the methods for the ExpressRouteGateways group. +// Don't use this type directly, use NewExpressRouteGatewaysClient() instead. +type ExpressRouteGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteGatewaysClient creates a new instance of ExpressRouteGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. +// - options - ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate +// method. +func (client *ExpressRouteGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRouteGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a ExpressRoute gateway in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters) +} + +// BeginDelete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only +// be deleted when there are no connection subresources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete +// method. +func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*runtime.Poller[ExpressRouteGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted +// when there are no connection subresources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Fetches the details of a ExpressRoute gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRouteGatewayName - The name of the ExpressRoute gateway. +// - options - ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get +// method. +func (client *ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientGetOptions) (ExpressRouteGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, options) + if err != nil { + return ExpressRouteGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteGatewaysClient) getHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientGetResponse, error) { + result := ExpressRouteGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGateway); err != nil { + return ExpressRouteGatewaysClientGetResponse{}, err + } + return result, nil +} + +// ListByResourceGroup - Lists ExpressRoute gateways in a given resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup +// method. +func (client *ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (ExpressRouteGatewaysClientListByResourceGroupResponse, error) { + req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + if err != nil { + return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ExpressRouteGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientListByResourceGroupResponse, error) { + result := ExpressRouteGatewaysClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGatewayList); err != nil { + return ExpressRouteGatewaysClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// ListBySubscription - Lists ExpressRoute gateways under a given subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription +// method. +func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { + req, err := client.listBySubscriptionCreateRequest(ctx, options) + if err != nil { + return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteGatewaysClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ExpressRouteGatewaysClient) listBySubscriptionHandleResponse(resp *http.Response) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { + result := ExpressRouteGatewaysClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteGatewayList); err != nil { + return ExpressRouteGatewaysClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdateTags - Updates express route gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the ExpressRouteGateway. +// - expressRouteGatewayName - The name of the gateway. +// - expressRouteGatewayParameters - Parameters supplied to update a virtual wan express route gateway tags. +// - options - ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags +// method. +func (client *ExpressRouteGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[ExpressRouteGatewaysClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRouteGatewaysClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRouteGatewaysClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates express route gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRouteGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}" + 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 expressRouteGatewayName == "" { + return nil, errors.New("parameter expressRouteGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRouteGatewayName}", url.PathEscape(expressRouteGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, expressRouteGatewayParameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutelinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutelinks_client.go new file mode 100644 index 00000000000..e63cef5137c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressroutelinks_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteLinksClient contains the methods for the ExpressRouteLinks group. +// Don't use this type directly, use NewExpressRouteLinksClient() instead. +type ExpressRouteLinksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteLinksClient creates a new instance of ExpressRouteLinksClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteLinksClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteLinksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieves the specified ExpressRouteLink resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - linkName - The name of the ExpressRouteLink resource. +// - options - ExpressRouteLinksClientGetOptions contains the optional parameters for the ExpressRouteLinksClient.Get method. +func (client *ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (ExpressRouteLinksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, linkName, options) + if err != nil { + return ExpressRouteLinksClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteLinksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteLinksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + if linkName == "" { + return nil, errors.New("parameter linkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkName}", url.PathEscape(linkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRouteLinksClient) getHandleResponse(resp *http.Response) (ExpressRouteLinksClientGetResponse, error) { + result := ExpressRouteLinksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteLink); err != nil { + return ExpressRouteLinksClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - options - ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.NewListPager +// method. +func (client *ExpressRouteLinksClient) NewListPager(resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) *runtime.Pager[ExpressRouteLinksClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteLinksClientListResponse]{ + More: func(page ExpressRouteLinksClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteLinksClientListResponse) (ExpressRouteLinksClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteLinksClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteLinksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteLinksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteLinksClient) listHandleResponse(resp *http.Response) (ExpressRouteLinksClientListResponse, error) { + result := ExpressRouteLinksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteLinkListResult); err != nil { + return ExpressRouteLinksClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportauthorizations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportauthorizations_client.go new file mode 100644 index 00000000000..6d7705a4b55 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportauthorizations_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRoutePortAuthorizationsClient contains the methods for the ExpressRoutePortAuthorizations group. +// Don't use this type directly, use NewExpressRoutePortAuthorizationsClient() instead. +type ExpressRoutePortAuthorizationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRoutePortAuthorizationsClient creates a new instance of ExpressRoutePortAuthorizationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRoutePortAuthorizationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortAuthorizationsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRoutePortAuthorizationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRoutePortAuthorizationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an authorization in the specified express route port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the express route port. +// - authorizationName - The name of the authorization. +// - authorizationParameters - Parameters supplied to the create or update express route port authorization operation. +// - options - ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRoutePortAuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an authorization in the specified express route port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRoutePortAuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, authorizationParameters) +} + +// BeginDelete - Deletes the specified authorization from the specified express route port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the express route port. +// - authorizationName - The name of the authorization. +// - options - ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete +// method. +func (client *ExpressRoutePortAuthorizationsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*runtime.Poller[ExpressRoutePortAuthorizationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortAuthorizationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRoutePortAuthorizationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified authorization from the specified express route port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified authorization from the specified express route port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the express route port. +// - authorizationName - The name of the authorization. +// - options - ExpressRoutePortAuthorizationsClientGetOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.Get +// method. +func (client *ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientGetOptions) (ExpressRoutePortAuthorizationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, authorizationName, options) + if err != nil { + return ExpressRoutePortAuthorizationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortAuthorizationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortAuthorizationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + if authorizationName == "" { + return nil, errors.New("parameter authorizationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationName}", url.PathEscape(authorizationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortAuthorizationsClientGetResponse, error) { + result := ExpressRoutePortAuthorizationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortAuthorization); err != nil { + return ExpressRoutePortAuthorizationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all authorizations in an express route port. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the express route port. +// - options - ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.NewListPager +// method. +func (client *ExpressRoutePortAuthorizationsClient) NewListPager(resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortAuthorizationsClientListOptions) *runtime.Pager[ExpressRoutePortAuthorizationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortAuthorizationsClientListResponse]{ + More: func(page ExpressRoutePortAuthorizationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRoutePortAuthorizationsClientListResponse) (ExpressRoutePortAuthorizationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRoutePortAuthorizationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortAuthorizationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortAuthorizationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortAuthorizationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRoutePortAuthorizationsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortAuthorizationsClientListResponse, error) { + result := ExpressRoutePortAuthorizationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortAuthorizationListResult); err != nil { + return ExpressRoutePortAuthorizationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteports_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteports_client.go new file mode 100644 index 00000000000..27656cf2ec0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteports_client.go @@ -0,0 +1,481 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRoutePortsClient contains the methods for the ExpressRoutePorts group. +// Don't use this type directly, use NewExpressRoutePortsClient() instead. +type ExpressRoutePortsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRoutePortsClient creates a new instance of ExpressRoutePortsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRoutePortsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRoutePortsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRoutePortsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - parameters - Parameters supplied to the create ExpressRoutePort operation. +// - options - ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate +// method. +func (client *ExpressRoutePortsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExpressRoutePortsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, expressRoutePortName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRoutePortsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRoutePortsClient) createOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, expressRoutePortName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - options - ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete +// method. +func (client *ExpressRoutePortsClient) BeginDelete(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*runtime.Poller[ExpressRoutePortsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, expressRoutePortName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExpressRoutePortsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ExpressRoutePortsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GenerateLOA - Generate a letter of authorization for the requested ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of ExpressRoutePort. +// - request - Request parameters supplied to generate a letter of authorization. +// - options - ExpressRoutePortsClientGenerateLOAOptions contains the optional parameters for the ExpressRoutePortsClient.GenerateLOA +// method. +func (client *ExpressRoutePortsClient) GenerateLOA(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest, options *ExpressRoutePortsClientGenerateLOAOptions) (ExpressRoutePortsClientGenerateLOAResponse, error) { + req, err := client.generateLOACreateRequest(ctx, resourceGroupName, expressRoutePortName, request, options) + if err != nil { + return ExpressRoutePortsClientGenerateLOAResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsClientGenerateLOAResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsClientGenerateLOAResponse{}, runtime.NewResponseError(resp) + } + return client.generateLOAHandleResponse(resp) +} + +// generateLOACreateRequest creates the GenerateLOA request. +func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest, options *ExpressRoutePortsClientGenerateLOAOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} + +// generateLOAHandleResponse handles the GenerateLOA response. +func (client *ExpressRoutePortsClient) generateLOAHandleResponse(resp *http.Response) (ExpressRoutePortsClientGenerateLOAResponse, error) { + result := ExpressRoutePortsClientGenerateLOAResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GenerateExpressRoutePortsLOAResult); err != nil { + return ExpressRoutePortsClientGenerateLOAResponse{}, err + } + return result, nil +} + +// Get - Retrieves the requested ExpressRoutePort resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of ExpressRoutePort. +// - options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. +func (client *ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (ExpressRoutePortsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, expressRoutePortName, options) + if err != nil { + return ExpressRoutePortsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortsClientGetResponse, error) { + result := ExpressRoutePortsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePort); err != nil { + return ExpressRoutePortsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all the ExpressRoutePort resources in the specified subscription. +// +// Generated from API version 2022-09-01 +// - options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager +// method. +func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsClientListResponse]{ + More: func(page ExpressRoutePortsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRoutePortsClientListResponse) (ExpressRoutePortsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRoutePortsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortsClientListResponse, error) { + result := ExpressRoutePortsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortListResult); err != nil { + return ExpressRoutePortsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager +// method. +func (client *ExpressRoutePortsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) *runtime.Pager[ExpressRoutePortsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsClientListByResourceGroupResponse]{ + More: func(page ExpressRoutePortsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRoutePortsClientListByResourceGroupResponse) (ExpressRoutePortsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRoutePortsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ExpressRoutePortsClient) listByResourceGroupHandleResponse(resp *http.Response) (ExpressRoutePortsClientListByResourceGroupResponse, error) { + result := ExpressRoutePortsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortListResult); err != nil { + return ExpressRoutePortsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Update ExpressRoutePort tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - expressRoutePortName - The name of the ExpressRoutePort resource. +// - parameters - Parameters supplied to update ExpressRoutePort resource tags. +// - options - ExpressRoutePortsClientUpdateTagsOptions contains the optional parameters for the ExpressRoutePortsClient.UpdateTags +// method. +func (client *ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, options *ExpressRoutePortsClientUpdateTagsOptions) (ExpressRoutePortsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, expressRoutePortName, parameters, options) + if err != nil { + return ExpressRoutePortsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, options *ExpressRoutePortsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" + 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 expressRoutePortName == "" { + return nil, errors.New("parameter expressRoutePortName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{expressRoutePortName}", url.PathEscape(expressRoutePortName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ExpressRoutePortsClient) updateTagsHandleResponse(resp *http.Response) (ExpressRoutePortsClientUpdateTagsResponse, error) { + result := ExpressRoutePortsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePort); err != nil { + return ExpressRoutePortsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportslocations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportslocations_client.go new file mode 100644 index 00000000000..5ffb3af9ca8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteportslocations_client.go @@ -0,0 +1,161 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRoutePortsLocationsClient contains the methods for the ExpressRoutePortsLocations group. +// Don't use this type directly, use NewExpressRoutePortsLocationsClient() instead. +type ExpressRoutePortsLocationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRoutePortsLocationsClient creates a new instance of ExpressRoutePortsLocationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRoutePortsLocationsClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRoutePortsLocationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRoutePortsLocationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said +// peering location. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - locationName - Name of the requested ExpressRoutePort peering location. +// - options - ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get +// method. +func (client *ExpressRoutePortsLocationsClient) Get(ctx context.Context, locationName string, options *ExpressRoutePortsLocationsClientGetOptions) (ExpressRoutePortsLocationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, locationName, options) + if err != nil { + return ExpressRoutePortsLocationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsLocationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsLocationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Context, locationName string, options *ExpressRoutePortsLocationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExpressRoutePortsLocationsClient) getHandleResponse(resp *http.Response) (ExpressRoutePortsLocationsClientGetResponse, error) { + result := ExpressRoutePortsLocationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortsLocation); err != nil { + return ExpressRoutePortsLocationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. +// Available bandwidths can only be obtained when retrieving a specific peering location. +// +// Generated from API version 2022-09-01 +// - options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager +// method. +func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsLocationsClientListResponse]{ + More: func(page ExpressRoutePortsLocationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRoutePortsLocationsClientListResponse) (ExpressRoutePortsLocationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRoutePortsLocationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRoutePortsLocationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRoutePortsLocationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsLocationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRoutePortsLocationsClient) listHandleResponse(resp *http.Response) (ExpressRoutePortsLocationsClientListResponse, error) { + result := ExpressRoutePortsLocationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRoutePortsLocationListResult); err != nil { + return ExpressRoutePortsLocationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteproviderportslocation_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteproviderportslocation_client.go new file mode 100644 index 00000000000..923651de44b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteproviderportslocation_client.go @@ -0,0 +1,97 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteProviderPortsLocationClient contains the methods for the ExpressRouteProviderPortsLocation group. +// Don't use this type directly, use NewExpressRouteProviderPortsLocationClient() instead. +type ExpressRouteProviderPortsLocationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteProviderPortsLocationClient creates a new instance of ExpressRouteProviderPortsLocationClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteProviderPortsLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteProviderPortsLocationClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteProviderPortsLocationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteProviderPortsLocationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Retrieves all the ExpressRouteProviderPorts in a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List +// method. +func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return ExpressRouteProviderPortsLocationClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteProviderPortsLocationClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteProviderPortsLocationClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts" + 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", "2022-09-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteProviderPortsLocationClient) listHandleResponse(resp *http.Response) (ExpressRouteProviderPortsLocationClientListResponse, error) { + result := ExpressRouteProviderPortsLocationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteProviderPortListResult); err != nil { + return ExpressRouteProviderPortsLocationClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteserviceproviders_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteserviceproviders_client.go new file mode 100644 index 00000000000..916139130ff --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/expressrouteserviceproviders_client.go @@ -0,0 +1,106 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ExpressRouteServiceProvidersClient contains the methods for the ExpressRouteServiceProviders group. +// Don't use this type directly, use NewExpressRouteServiceProvidersClient() instead. +type ExpressRouteServiceProvidersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExpressRouteServiceProvidersClient creates a new instance of ExpressRouteServiceProvidersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExpressRouteServiceProvidersClient, error) { + cl, err := arm.NewClient(moduleName+".ExpressRouteServiceProvidersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExpressRouteServiceProvidersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets all the available express route service providers. +// +// Generated from API version 2022-09-01 +// - options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager +// method. +func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExpressRouteServiceProvidersClientListResponse]{ + More: func(page ExpressRouteServiceProvidersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExpressRouteServiceProvidersClientListResponse) (ExpressRouteServiceProvidersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ExpressRouteServiceProvidersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExpressRouteServiceProvidersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExpressRouteServiceProvidersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context.Context, options *ExpressRouteServiceProvidersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExpressRouteServiceProvidersClient) listHandleResponse(resp *http.Response) (ExpressRouteServiceProvidersClientListResponse, error) { + result := ExpressRouteServiceProvidersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteServiceProviderListResult); err != nil { + return ExpressRouteServiceProvidersClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicies_client.go new file mode 100644 index 00000000000..6ee904eb435 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicies_client.go @@ -0,0 +1,425 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FirewallPoliciesClient contains the methods for the FirewallPolicies group. +// Don't use this type directly, use NewFirewallPoliciesClient() instead. +type FirewallPoliciesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallPoliciesClient creates a new instance of FirewallPoliciesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPoliciesClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallPoliciesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallPoliciesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Firewall Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - parameters - Parameters supplied to the create or update Firewall Policy operation. +// - options - FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate +// method. +func (client *FirewallPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallPoliciesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPoliciesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Firewall Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FirewallPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Firewall Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete +// method. +func (client *FirewallPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*runtime.Poller[FirewallPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, firewallPolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPoliciesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Firewall Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Firewall Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. +func (client *FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (FirewallPoliciesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) + if err != nil { + return FirewallPoliciesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPoliciesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (FirewallPoliciesClientGetResponse, error) { + result := FirewallPoliciesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicy); err != nil { + return FirewallPoliciesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all Firewall Policies in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager +// method. +func (client *FirewallPoliciesClient) NewListPager(resourceGroupName string, options *FirewallPoliciesClientListOptions) *runtime.Pager[FirewallPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallPoliciesClientListResponse]{ + More: func(page FirewallPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallPoliciesClientListResponse) (FirewallPoliciesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FirewallPoliciesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPoliciesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPoliciesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *FirewallPoliciesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (FirewallPoliciesClientListResponse, error) { + result := FirewallPoliciesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyListResult); err != nil { + return FirewallPoliciesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the Firewall Policies in a subscription. +// +// Generated from API version 2022-09-01 +// - options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager +// method. +func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallPoliciesClientListAllResponse]{ + More: func(page FirewallPoliciesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallPoliciesClientListAllResponse) (FirewallPoliciesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FirewallPoliciesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPoliciesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPoliciesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *FirewallPoliciesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *FirewallPoliciesClient) listAllHandleResponse(resp *http.Response) (FirewallPoliciesClientListAllResponse, error) { + result := FirewallPoliciesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyListResult); err != nil { + return FirewallPoliciesClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags of a Azure Firewall Policy resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - parameters - Parameters supplied to update Azure Firewall Policy tags. +// - options - FirewallPoliciesClientUpdateTagsOptions contains the optional parameters for the FirewallPoliciesClient.UpdateTags +// method. +func (client *FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject, options *FirewallPoliciesClientUpdateTagsOptions) (FirewallPoliciesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return FirewallPoliciesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPoliciesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject, options *FirewallPoliciesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *FirewallPoliciesClient) updateTagsHandleResponse(resp *http.Response) (FirewallPoliciesClientUpdateTagsResponse, error) { + result := FirewallPoliciesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicy); err != nil { + return FirewallPoliciesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignatures_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignatures_client.go new file mode 100644 index 00000000000..ba5361dda16 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignatures_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FirewallPolicyIdpsSignaturesClient contains the methods for the FirewallPolicyIdpsSignatures group. +// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesClient() instead. +type FirewallPolicyIdpsSignaturesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallPolicyIdpsSignaturesClient creates a new instance of FirewallPolicyIdpsSignaturesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallPolicyIdpsSignaturesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallPolicyIdpsSignaturesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Retrieves the current status of IDPS signatures for the relevant policy +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List +// method. +func (client *FirewallPolicyIdpsSignaturesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject, options *FirewallPolicyIdpsSignaturesClientListOptions) (FirewallPolicyIdpsSignaturesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return FirewallPolicyIdpsSignaturesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject, options *FirewallPolicyIdpsSignaturesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listHandleResponse handles the List response. +func (client *FirewallPolicyIdpsSignaturesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesClientListResponse, error) { + result := FirewallPolicyIdpsSignaturesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.QueryResults); err != nil { + return FirewallPolicyIdpsSignaturesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesfiltervalues_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesfiltervalues_client.go new file mode 100644 index 00000000000..a6801d933e4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesfiltervalues_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FirewallPolicyIdpsSignaturesFilterValuesClient contains the methods for the FirewallPolicyIdpsSignaturesFilterValues group. +// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesFilterValuesClient() instead. +type FirewallPolicyIdpsSignaturesFilterValuesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallPolicyIdpsSignaturesFilterValuesClient creates a new instance of FirewallPolicyIdpsSignaturesFilterValuesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesFilterValuesClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallPolicyIdpsSignaturesFilterValuesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallPolicyIdpsSignaturesFilterValuesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Retrieves the current filter values for the signatures overrides +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List +// method. +func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignatureOverridesFilterValuesQuery, options *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (FirewallPolicyIdpsSignaturesFilterValuesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignatureOverridesFilterValuesQuery, options *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listHandleResponse handles the List response. +func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesFilterValuesClientListResponse, error) { + result := FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SignatureOverridesFilterValuesResponse); err != nil { + return FirewallPolicyIdpsSignaturesFilterValuesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesoverrides_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesoverrides_client.go new file mode 100644 index 00000000000..eef79210bd7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyidpssignaturesoverrides_client.go @@ -0,0 +1,280 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FirewallPolicyIdpsSignaturesOverridesClient contains the methods for the FirewallPolicyIdpsSignaturesOverrides group. +// Don't use this type directly, use NewFirewallPolicyIdpsSignaturesOverridesClient() instead. +type FirewallPolicyIdpsSignaturesOverridesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallPolicyIdpsSignaturesOverridesClient creates a new instance of FirewallPolicyIdpsSignaturesOverridesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyIdpsSignaturesOverridesClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallPolicyIdpsSignaturesOverridesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallPolicyIdpsSignaturesOverridesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Returns all signatures overrides for a specific policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get +// method. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (FirewallPolicyIdpsSignaturesOverridesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) getHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientGetResponse, error) { + result := FirewallPolicyIdpsSignaturesOverridesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientGetResponse{}, err + } + return result, nil +} + +// List - Returns all signatures overrides objects for a specific policy as a list containing a single value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List +// method. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (FirewallPolicyIdpsSignaturesOverridesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) listHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientListResponse, error) { + result := FirewallPolicyIdpsSignaturesOverridesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverridesList); err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientListResponse{}, err + } + return result, nil +} + +// Patch - Will update the status of policy's signature overrides for IDPS +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - parameters - Will contain all properties of the object to put +// - options - FirewallPolicyIdpsSignaturesOverridesClientPatchOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Patch +// method. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) Patch(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (FirewallPolicyIdpsSignaturesOverridesClientPatchResponse, error) { + req, err := client.patchCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, runtime.NewResponseError(resp) + } + return client.patchHandleResponse(resp) +} + +// patchCreateRequest creates the Patch request. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// patchHandleResponse handles the Patch response. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientPatchResponse, error) { + result := FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPatchResponse{}, err + } + return result, nil +} + +// Put - Will override/create a new signature overrides for the policy's IDPS +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - parameters - Will contain all properties of the object to put +// - options - FirewallPolicyIdpsSignaturesOverridesClientPutOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Put +// method. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) Put(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (FirewallPolicyIdpsSignaturesOverridesClientPutResponse, error) { + req, err := client.putCreateRequest(ctx, resourceGroupName, firewallPolicyName, parameters, options) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, runtime.NewResponseError(resp) + } + return client.putHandleResponse(resp) +} + +// putCreateRequest creates the Put request. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters SignaturesOverrides, options *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// putHandleResponse handles the Put response. +func (client *FirewallPolicyIdpsSignaturesOverridesClient) putHandleResponse(resp *http.Response) (FirewallPolicyIdpsSignaturesOverridesClientPutResponse, error) { + result := FirewallPolicyIdpsSignaturesOverridesClientPutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SignaturesOverrides); err != nil { + return FirewallPolicyIdpsSignaturesOverridesClientPutResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyrulecollectiongroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyrulecollectiongroups_client.go new file mode 100644 index 00000000000..17ab5be817e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/firewallpolicyrulecollectiongroups_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FirewallPolicyRuleCollectionGroupsClient contains the methods for the FirewallPolicyRuleCollectionGroups group. +// Don't use this type directly, use NewFirewallPolicyRuleCollectionGroupsClient() instead. +type FirewallPolicyRuleCollectionGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallPolicyRuleCollectionGroupsClient creates a new instance of FirewallPolicyRuleCollectionGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallPolicyRuleCollectionGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallPolicyRuleCollectionGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallPolicyRuleCollectionGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - parameters - Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. +// - options - FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate +// method. +func (client *FirewallPolicyRuleCollectionGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified FirewallPolicyRuleCollectionGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + if ruleCollectionGroupName == "" { + return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - options - FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete +// method. +func (client *FirewallPolicyRuleCollectionGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*runtime.Poller[FirewallPolicyRuleCollectionGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallPolicyRuleCollectionGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallPolicyRuleCollectionGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified FirewallPolicyRuleCollectionGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + if ruleCollectionGroupName == "" { + return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified FirewallPolicyRuleCollectionGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. +// - options - FirewallPolicyRuleCollectionGroupsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.Get +// method. +func (client *FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (FirewallPolicyRuleCollectionGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, options) + if err != nil { + return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + if ruleCollectionGroupName == "" { + return nil, errors.New("parameter ruleCollectionGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionGroupName}", url.PathEscape(ruleCollectionGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp *http.Response) (FirewallPolicyRuleCollectionGroupsClientGetResponse, error) { + result := FirewallPolicyRuleCollectionGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyRuleCollectionGroup); err != nil { + return FirewallPolicyRuleCollectionGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - firewallPolicyName - The name of the Firewall Policy. +// - options - FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.NewListPager +// method. +func (client *FirewallPolicyRuleCollectionGroupsClient) NewListPager(resourceGroupName string, firewallPolicyName string, options *FirewallPolicyRuleCollectionGroupsClientListOptions) *runtime.Pager[FirewallPolicyRuleCollectionGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallPolicyRuleCollectionGroupsClientListResponse]{ + More: func(page FirewallPolicyRuleCollectionGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallPolicyRuleCollectionGroupsClientListResponse) (FirewallPolicyRuleCollectionGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, firewallPolicyName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallPolicyRuleCollectionGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyRuleCollectionGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if firewallPolicyName == "" { + return nil, errors.New("parameter firewallPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallPolicyName}", url.PathEscape(firewallPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FirewallPolicyRuleCollectionGroupsClient) listHandleResponse(resp *http.Response) (FirewallPolicyRuleCollectionGroupsClientListResponse, error) { + result := FirewallPolicyRuleCollectionGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallPolicyRuleCollectionGroupListResult); err != nil { + return FirewallPolicyRuleCollectionGroupsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/flowlogs_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/flowlogs_client.go new file mode 100644 index 00000000000..44d7cccd8a1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/flowlogs_client.go @@ -0,0 +1,384 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// FlowLogsClient contains the methods for the FlowLogs group. +// Don't use this type directly, use NewFlowLogsClient() instead. +type FlowLogsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFlowLogsClient creates a new instance of FlowLogsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFlowLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlowLogsClient, error) { + cl, err := arm.NewClient(moduleName+".FlowLogsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FlowLogsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a flow log for the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - flowLogName - The name of the flow log. +// - parameters - Parameters that define the create or update flow log resource. +// - options - FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate +// method. +func (client *FlowLogsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FlowLogsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlowLogsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FlowLogsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update a flow log for the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FlowLogsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog, options *FlowLogsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if flowLogName == "" { + return nil, errors.New("parameter flowLogName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified flow log resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - flowLogName - The name of the flow log resource. +// - options - FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. +func (client *FlowLogsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*runtime.Poller[FlowLogsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, flowLogName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FlowLogsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[FlowLogsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified flow log resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *FlowLogsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if flowLogName == "" { + return nil, errors.New("parameter flowLogName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a flow log resource by name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - flowLogName - The name of the flow log resource. +// - options - FlowLogsClientGetOptions contains the optional parameters for the FlowLogsClient.Get method. +func (client *FlowLogsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientGetOptions) (FlowLogsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, options) + if err != nil { + return FlowLogsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FlowLogsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FlowLogsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *FlowLogsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if flowLogName == "" { + return nil, errors.New("parameter flowLogName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsClientGetResponse, error) { + result := FlowLogsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FlowLog); err != nil { + return FlowLogsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all flow log resources for the specified Network Watcher. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group containing Network Watcher. +// - networkWatcherName - The name of the Network Watcher resource. +// - options - FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.NewListPager method. +func (client *FlowLogsClient) NewListPager(resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) *runtime.Pager[FlowLogsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FlowLogsClientListResponse]{ + More: func(page FlowLogsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FlowLogsClientListResponse) (FlowLogsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FlowLogsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FlowLogsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FlowLogsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FlowLogsClient) listHandleResponse(resp *http.Response) (FlowLogsClientListResponse, error) { + result := FlowLogsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FlowLogListResult); err != nil { + return FlowLogsClientListResponse{}, err + } + return result, nil +} + +// UpdateTags - Update tags of the specified flow log. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - flowLogName - The name of the flow log. +// - parameters - Parameters supplied to update flow log tags. +// - options - FlowLogsClientUpdateTagsOptions contains the optional parameters for the FlowLogsClient.UpdateTags method. +func (client *FlowLogsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, options *FlowLogsClientUpdateTagsOptions) (FlowLogsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters, options) + if err != nil { + return FlowLogsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FlowLogsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FlowLogsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject, options *FlowLogsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if flowLogName == "" { + return nil, errors.New("parameter flowLogName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{flowLogName}", url.PathEscape(flowLogName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *FlowLogsClient) updateTagsHandleResponse(resp *http.Response) (FlowLogsClientUpdateTagsResponse, error) { + result := FlowLogsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FlowLog); err != nil { + return FlowLogsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/groups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/groups_client.go new file mode 100644 index 00000000000..4cf5766fcc1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/groups_client.go @@ -0,0 +1,327 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// GroupsClient contains the methods for the NetworkGroups group. +// Don't use this type directly, use NewGroupsClient() instead. +type GroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGroupsClient creates a new instance of GroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupsClient, error) { + cl, err := arm.NewClient(moduleName+".GroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a network group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - parameters - Parameters supplied to the specify which network group need to create +// - options - GroupsClientCreateOrUpdateOptions contains the optional parameters for the GroupsClient.CreateOrUpdate method. +func (client *GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, parameters Group, options *GroupsClientCreateOrUpdateOptions) (GroupsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, parameters, options) + if err != nil { + return GroupsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GroupsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return GroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, parameters Group, options *GroupsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GroupsClient) createOrUpdateHandleResponse(resp *http.Response) (GroupsClientCreateOrUpdateResponse, error) { + result := GroupsClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.Group); err != nil { + return GroupsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a network group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - options - GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method. +func (client *GroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*runtime.Poller[GroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, networkGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a network group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *GroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified network group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - options - GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method. +func (client *GroupsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientGetOptions) (GroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) + if err != nil { + return GroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClientGetResponse, error) { + result := GroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Group); err != nil { + return GroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the specified network group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. +func (client *GroupsClient) NewListPager(resourceGroupName string, networkManagerName string, options *GroupsClientListOptions) *runtime.Pager[GroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GroupsClientListResponse]{ + More: func(page GroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GroupsClientListResponse) (GroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *GroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GroupsClient) listHandleResponse(resp *http.Response) (GroupsClientListResponse, error) { + result := GroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GroupListResult); err != nil { + return GroupsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubroutetables_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubroutetables_client.go new file mode 100644 index 00000000000..4454e3bca49 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubroutetables_client.go @@ -0,0 +1,322 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// HubRouteTablesClient contains the methods for the HubRouteTables group. +// Don't use this type directly, use NewHubRouteTablesClient() instead. +type HubRouteTablesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewHubRouteTablesClient creates a new instance of HubRouteTablesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewHubRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubRouteTablesClient, error) { + cl, err := arm.NewClient(moduleName+".HubRouteTablesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &HubRouteTablesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the RouteTable. +// - routeTableParameters - Parameters supplied to create or update RouteTable. +// - options - HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate +// method. +func (client *HubRouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[HubRouteTablesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubRouteTablesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[HubRouteTablesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *HubRouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routeTableParameters) +} + +// BeginDelete - Deletes a RouteTable. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RouteTable. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the RouteTable. +// - options - HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete +// method. +func (client *HubRouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*runtime.Poller[HubRouteTablesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubRouteTablesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[HubRouteTablesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a RouteTable. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *HubRouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a RouteTable. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the RouteTable. +// - options - HubRouteTablesClientGetOptions contains the optional parameters for the HubRouteTablesClient.Get method. +func (client *HubRouteTablesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (HubRouteTablesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return HubRouteTablesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HubRouteTablesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HubRouteTablesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubRouteTablesClientGetResponse, error) { + result := HubRouteTablesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HubRouteTable); err != nil { + return HubRouteTablesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all RouteTables. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.NewListPager method. +func (client *HubRouteTablesClient) NewListPager(resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) *runtime.Pager[HubRouteTablesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[HubRouteTablesClientListResponse]{ + More: func(page HubRouteTablesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *HubRouteTablesClientListResponse) (HubRouteTablesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return HubRouteTablesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HubRouteTablesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HubRouteTablesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *HubRouteTablesClient) listHandleResponse(resp *http.Response) (HubRouteTablesClientListResponse, error) { + result := HubRouteTablesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListHubRouteTablesResult); err != nil { + return HubRouteTablesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubvirtualnetworkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubvirtualnetworkconnections_client.go new file mode 100644 index 00000000000..daf4dba11e0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/hubvirtualnetworkconnections_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// HubVirtualNetworkConnectionsClient contains the methods for the HubVirtualNetworkConnections group. +// Don't use this type directly, use NewHubVirtualNetworkConnectionsClient() instead. +type HubVirtualNetworkConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewHubVirtualNetworkConnectionsClient creates a new instance of HubVirtualNetworkConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewHubVirtualNetworkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HubVirtualNetworkConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".HubVirtualNetworkConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &HubVirtualNetworkConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the HubVirtualNetworkConnection. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the HubVirtualNetworkConnection. +// - hubVirtualNetworkConnectionParameters - Parameters supplied to create or update a hub virtual network connection. +// - options - HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate +// method. +func (client *HubVirtualNetworkConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[HubVirtualNetworkConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a hub virtual network connection if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *HubVirtualNetworkConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters) +} + +// BeginDelete - Deletes a HubVirtualNetworkConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the HubVirtualNetworkConnection. +// - options - HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete +// method. +func (client *HubVirtualNetworkConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*runtime.Poller[HubVirtualNetworkConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HubVirtualNetworkConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[HubVirtualNetworkConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a HubVirtualNetworkConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *HubVirtualNetworkConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a HubVirtualNetworkConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the vpn connection. +// - options - HubVirtualNetworkConnectionsClientGetOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.Get +// method. +func (client *HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (HubVirtualNetworkConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return HubVirtualNetworkConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HubVirtualNetworkConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HubVirtualNetworkConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.Response) (HubVirtualNetworkConnectionsClientGetResponse, error) { + result := HubVirtualNetworkConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HubVirtualNetworkConnection); err != nil { + return HubVirtualNetworkConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all HubVirtualNetworkConnections. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.NewListPager +// method. +func (client *HubVirtualNetworkConnectionsClient) NewListPager(resourceGroupName string, virtualHubName string, options *HubVirtualNetworkConnectionsClientListOptions) *runtime.Pager[HubVirtualNetworkConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[HubVirtualNetworkConnectionsClientListResponse]{ + More: func(page HubVirtualNetworkConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *HubVirtualNetworkConnectionsClientListResponse) (HubVirtualNetworkConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return HubVirtualNetworkConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HubVirtualNetworkConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HubVirtualNetworkConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubVirtualNetworkConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *HubVirtualNetworkConnectionsClient) listHandleResponse(resp *http.Response) (HubVirtualNetworkConnectionsClientListResponse, error) { + result := HubVirtualNetworkConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListHubVirtualNetworkConnectionsResult); err != nil { + return HubVirtualNetworkConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundnatrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundnatrules_client.go new file mode 100644 index 00000000000..bd9720cb183 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundnatrules_client.go @@ -0,0 +1,326 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InboundNatRulesClient contains the methods for the InboundNatRules group. +// Don't use this type directly, use NewInboundNatRulesClient() instead. +type InboundNatRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInboundNatRulesClient creates a new instance of InboundNatRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInboundNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundNatRulesClient, error) { + cl, err := arm.NewClient(moduleName+".InboundNatRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InboundNatRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a load balancer inbound NAT rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - inboundNatRuleName - The name of the inbound NAT rule. +// - inboundNatRuleParameters - Parameters supplied to the create or update inbound NAT rule operation. +// - options - InboundNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundNatRulesClient.BeginCreateOrUpdate +// method. +func (client *InboundNatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[InboundNatRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundNatRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InboundNatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a load balancer inbound NAT rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InboundNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if inboundNatRuleName == "" { + return nil, errors.New("parameter inboundNatRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, inboundNatRuleParameters) +} + +// BeginDelete - Deletes the specified load balancer inbound NAT rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - inboundNatRuleName - The name of the inbound NAT rule. +// - options - InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete +// method. +func (client *InboundNatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*runtime.Poller[InboundNatRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundNatRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InboundNatRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified load balancer inbound NAT rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InboundNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if inboundNatRuleName == "" { + return nil, errors.New("parameter inboundNatRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified load balancer inbound NAT rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - inboundNatRuleName - The name of the inbound NAT rule. +// - options - InboundNatRulesClientGetOptions contains the optional parameters for the InboundNatRulesClient.Get method. +func (client *InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientGetOptions) (InboundNatRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, options) + if err != nil { + return InboundNatRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InboundNatRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InboundNatRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, options *InboundNatRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if inboundNatRuleName == "" { + return nil, errors.New("parameter inboundNatRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inboundNatRuleName}", url.PathEscape(inboundNatRuleName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (InboundNatRulesClientGetResponse, error) { + result := InboundNatRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InboundNatRule); err != nil { + return InboundNatRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the inbound NAT rules in a load balancer. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.NewListPager +// method. +func (client *InboundNatRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *InboundNatRulesClientListOptions) *runtime.Pager[InboundNatRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InboundNatRulesClientListResponse]{ + More: func(page InboundNatRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InboundNatRulesClientListResponse) (InboundNatRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InboundNatRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InboundNatRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InboundNatRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *InboundNatRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InboundNatRulesClient) listHandleResponse(resp *http.Response) (InboundNatRulesClientListResponse, error) { + result := InboundNatRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InboundNatRuleListResult); err != nil { + return InboundNatRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundsecurityrule_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundsecurityrule_client.go new file mode 100644 index 00000000000..bc000960131 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/inboundsecurityrule_client.go @@ -0,0 +1,119 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InboundSecurityRuleClient contains the methods for the InboundSecurityRule group. +// Don't use this type directly, use NewInboundSecurityRuleClient() instead. +type InboundSecurityRuleClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInboundSecurityRuleClient creates a new instance of InboundSecurityRuleClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInboundSecurityRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InboundSecurityRuleClient, error) { + cl, err := arm.NewClient(moduleName+".InboundSecurityRuleClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InboundSecurityRuleClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - ruleCollectionName - The name of security rule collection. +// - parameters - Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules operation. +// - options - InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate +// method. +func (client *InboundSecurityRuleClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*runtime.Poller[InboundSecurityRuleClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InboundSecurityRuleClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InboundSecurityRuleClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Inbound Security Rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InboundSecurityRuleClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + if ruleCollectionName == "" { + return nil, errors.New("parameter ruleCollectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleCollectionName}", url.PathEscape(ruleCollectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceipconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceipconfigurations_client.go new file mode 100644 index 00000000000..fe261280b27 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceipconfigurations_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InterfaceIPConfigurationsClient contains the methods for the NetworkInterfaceIPConfigurations group. +// Don't use this type directly, use NewInterfaceIPConfigurationsClient() instead. +type InterfaceIPConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInterfaceIPConfigurationsClient creates a new instance of InterfaceIPConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInterfaceIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceIPConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".InterfaceIPConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InterfaceIPConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified network interface ip configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - ipConfigurationName - The name of the ip configuration name. +// - options - InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get +// method. +func (client *InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, options *InterfaceIPConfigurationsClientGetOptions) (InterfaceIPConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, ipConfigurationName, options) + if err != nil { + return InterfaceIPConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfaceIPConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfaceIPConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, ipConfigurationName string, options *InterfaceIPConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InterfaceIPConfigurationsClient) getHandleResponse(resp *http.Response) (InterfaceIPConfigurationsClientGetResponse, error) { + result := InterfaceIPConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfiguration); err != nil { + return InterfaceIPConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all ip configurations in a network interface. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.NewListPager +// method. +func (client *InterfaceIPConfigurationsClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceIPConfigurationsClientListOptions) *runtime.Pager[InterfaceIPConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfaceIPConfigurationsClientListResponse]{ + More: func(page InterfaceIPConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfaceIPConfigurationsClientListResponse) (InterfaceIPConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfaceIPConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfaceIPConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfaceIPConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceIPConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InterfaceIPConfigurationsClient) listHandleResponse(resp *http.Response) (InterfaceIPConfigurationsClientListResponse, error) { + result := InterfaceIPConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfigurationListResult); err != nil { + return InterfaceIPConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceloadbalancers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceloadbalancers_client.go new file mode 100644 index 00000000000..c48641276ab --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaceloadbalancers_client.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InterfaceLoadBalancersClient contains the methods for the NetworkInterfaceLoadBalancers group. +// Don't use this type directly, use NewInterfaceLoadBalancersClient() instead. +type InterfaceLoadBalancersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInterfaceLoadBalancersClient creates a new instance of InterfaceLoadBalancersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceLoadBalancersClient, error) { + cl, err := arm.NewClient(moduleName+".InterfaceLoadBalancersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InterfaceLoadBalancersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List all load balancers in a network interface. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.NewListPager +// method. +func (client *InterfaceLoadBalancersClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceLoadBalancersClientListOptions) *runtime.Pager[InterfaceLoadBalancersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfaceLoadBalancersClientListResponse]{ + More: func(page InterfaceLoadBalancersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfaceLoadBalancersClientListResponse) (InterfaceLoadBalancersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfaceLoadBalancersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfaceLoadBalancersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfaceLoadBalancersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceLoadBalancersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InterfaceLoadBalancersClient) listHandleResponse(resp *http.Response) (InterfaceLoadBalancersClientListResponse, error) { + result := InterfaceLoadBalancersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceLoadBalancerListResult); err != nil { + return InterfaceLoadBalancersClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaces_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaces_client.go new file mode 100644 index 00000000000..c66931fb54a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfaces_client.go @@ -0,0 +1,1150 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InterfacesClient contains the methods for the NetworkInterfaces group. +// Don't use this type directly, use NewInterfacesClient() instead. +type InterfacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInterfacesClient creates a new instance of InterfacesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfacesClient, error) { + cl, err := arm.NewClient(moduleName+".InterfacesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InterfacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - parameters - Parameters supplied to the create or update network interface operation. +// - options - InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate +// method. +func (client *InterfacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[InterfacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkInterfaceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkInterfaceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface, options *InterfacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. +func (client *InterfacesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*runtime.Poller[InterfacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. +func (client *InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (InterfacesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return InterfacesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InterfacesClient) getHandleResponse(resp *http.Response) (InterfacesClientGetResponse, error) { + result := InterfacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return InterfacesClientGetResponse{}, err + } + return result, nil +} + +// GetCloudServiceNetworkInterface - Get the specified network interface in a cloud service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - roleInstanceName - The name of role instance. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientGetCloudServiceNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetCloudServiceNetworkInterface +// method. +func (client *InterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, options *InterfacesClientGetCloudServiceNetworkInterfaceOptions) (InterfacesClientGetCloudServiceNetworkInterfaceResponse, error) { + req, err := client.getCloudServiceNetworkInterfaceCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, options) + if err != nil { + return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, runtime.NewResponseError(resp) + } + return client.getCloudServiceNetworkInterfaceHandleResponse(resp) +} + +// getCloudServiceNetworkInterfaceCreateRequest creates the GetCloudServiceNetworkInterface request. +func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, options *InterfacesClientGetCloudServiceNetworkInterfaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + if roleInstanceName == "" { + return nil, errors.New("parameter roleInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCloudServiceNetworkInterfaceHandleResponse handles the GetCloudServiceNetworkInterface response. +func (client *InterfacesClient) getCloudServiceNetworkInterfaceHandleResponse(resp *http.Response) (InterfacesClientGetCloudServiceNetworkInterfaceResponse, error) { + result := InterfacesClientGetCloudServiceNetworkInterfaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return InterfacesClientGetCloudServiceNetworkInterfaceResponse{}, err + } + return result, nil +} + +// BeginGetEffectiveRouteTable - Gets all route tables applied to a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable +// method. +func (client *InterfacesClient) BeginGetEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*runtime.Poller[InterfacesClientGetEffectiveRouteTableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getEffectiveRouteTable(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientGetEffectiveRouteTableResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfacesClientGetEffectiveRouteTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetEffectiveRouteTable - Gets all route tables applied to a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { + req, err := client.getEffectiveRouteTableCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getEffectiveRouteTableCreateRequest creates the GetEffectiveRouteTable request. +func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GetVirtualMachineScaleSetIPConfiguration - Get the specified network interface ip configuration in a virtual machine scale +// set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - networkInterfaceName - The name of the network interface. +// - ipConfigurationName - The name of the ip configuration. +// - options - InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetIPConfiguration +// method. +func (client *InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse, error) { + req, err := client.getVirtualMachineScaleSetIPConfigurationCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) + if err != nil { + return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, runtime.NewResponseError(resp) + } + return client.getVirtualMachineScaleSetIPConfigurationHandleResponse(resp) +} + +// getVirtualMachineScaleSetIPConfigurationCreateRequest creates the GetVirtualMachineScaleSetIPConfiguration request. +func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + 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", "2018-10-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getVirtualMachineScaleSetIPConfigurationHandleResponse handles the GetVirtualMachineScaleSetIPConfiguration response. +func (client *InterfacesClient) getVirtualMachineScaleSetIPConfigurationHandleResponse(resp *http.Response) (InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse, error) { + result := InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfiguration); err != nil { + return InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse{}, err + } + return result, nil +} + +// GetVirtualMachineScaleSetNetworkInterface - Get the specified network interface in a virtual machine scale set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetNetworkInterface +// method. +func (client *InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error) { + req, err := client.getVirtualMachineScaleSetNetworkInterfaceCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) + if err != nil { + return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, runtime.NewResponseError(resp) + } + return client.getVirtualMachineScaleSetNetworkInterfaceHandleResponse(resp) +} + +// getVirtualMachineScaleSetNetworkInterfaceCreateRequest creates the GetVirtualMachineScaleSetNetworkInterface request. +func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2018-10-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getVirtualMachineScaleSetNetworkInterfaceHandleResponse handles the GetVirtualMachineScaleSetNetworkInterface response. +func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleResponse(resp *http.Response) (InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error) { + result := InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all network interfaces in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - InterfacesClientListOptions contains the optional parameters for the InterfacesClient.NewListPager method. +func (client *InterfacesClient) NewListPager(resourceGroupName string, options *InterfacesClientListOptions) *runtime.Pager[InterfacesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListResponse]{ + More: func(page InterfacesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListResponse) (InterfacesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *InterfacesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InterfacesClient) listHandleResponse(resp *http.Response) (InterfacesClientListResponse, error) { + result := InterfacesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all network interfaces in a subscription. +// +// Generated from API version 2022-09-01 +// - options - InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.NewListAllPager method. +func (client *InterfacesClient) NewListAllPager(options *InterfacesClientListAllOptions) *runtime.Pager[InterfacesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListAllResponse]{ + More: func(page InterfacesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListAllResponse) (InterfacesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, options *InterfacesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (InterfacesClientListAllResponse, error) { + result := InterfacesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListAllResponse{}, err + } + return result, nil +} + +// NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - options - InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceNetworkInterfacesPager +// method. +func (client *InterfacesClient) NewListCloudServiceNetworkInterfacesPager(resourceGroupName string, cloudServiceName string, options *InterfacesClientListCloudServiceNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListCloudServiceNetworkInterfacesResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListCloudServiceNetworkInterfacesResponse]{ + More: func(page InterfacesClientListCloudServiceNetworkInterfacesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListCloudServiceNetworkInterfacesResponse) (InterfacesClientListCloudServiceNetworkInterfacesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCloudServiceNetworkInterfacesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, runtime.NewResponseError(resp) + } + return client.listCloudServiceNetworkInterfacesHandleResponse(resp) + }, + }) +} + +// listCloudServiceNetworkInterfacesCreateRequest creates the ListCloudServiceNetworkInterfaces request. +func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *InterfacesClientListCloudServiceNetworkInterfacesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCloudServiceNetworkInterfacesHandleResponse handles the ListCloudServiceNetworkInterfaces response. +func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListCloudServiceNetworkInterfacesResponse, error) { + result := InterfacesClientListCloudServiceNetworkInterfacesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListCloudServiceNetworkInterfacesResponse{}, err + } + return result, nil +} + +// NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance +// in a cloud service. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - roleInstanceName - The name of role instance. +// - options - InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions contains the optional parameters for the +// InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager method. +func (client *InterfacesClient) NewListCloudServiceRoleInstanceNetworkInterfacesPager(resourceGroupName string, cloudServiceName string, roleInstanceName string, options *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse]{ + More: func(page InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse) (InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, runtime.NewResponseError(resp) + } + return client.listCloudServiceRoleInstanceNetworkInterfacesHandleResponse(resp) + }, + }) +} + +// listCloudServiceRoleInstanceNetworkInterfacesCreateRequest creates the ListCloudServiceRoleInstanceNetworkInterfaces request. +func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, options *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + if roleInstanceName == "" { + return nil, errors.New("parameter roleInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCloudServiceRoleInstanceNetworkInterfacesHandleResponse handles the ListCloudServiceRoleInstanceNetworkInterfaces response. +func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse, error) { + result := InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse{}, err + } + return result, nil +} + +// BeginListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups +// method. +func (client *InterfacesClient) BeginListEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*runtime.Poller[InterfacesClientListEffectiveNetworkSecurityGroupsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listEffectiveNetworkSecurityGroups(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfacesClientListEffectiveNetworkSecurityGroupsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfacesClientListEffectiveNetworkSecurityGroupsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListEffectiveNetworkSecurityGroups - Gets all network security groups applied to a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { + req, err := client.listEffectiveNetworkSecurityGroupsCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listEffectiveNetworkSecurityGroupsCreateRequest creates the ListEffectiveNetworkSecurityGroups request. +func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListVirtualMachineScaleSetIPConfigurationsPager - Get the specified network interface ip configuration in a virtual +// machine scale set. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - networkInterfaceName - The name of the network interface. +// - options - InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager +// method. +func (client *InterfacesClient) NewListVirtualMachineScaleSetIPConfigurationsPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse]{ + More: func(page InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse) (InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listVirtualMachineScaleSetIPConfigurationsCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, runtime.NewResponseError(resp) + } + return client.listVirtualMachineScaleSetIPConfigurationsHandleResponse(resp) + }, + }) +} + +// listVirtualMachineScaleSetIPConfigurationsCreateRequest creates the ListVirtualMachineScaleSetIPConfigurations request. +func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, options *InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2018-10-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachineScaleSetIPConfigurationsHandleResponse handles the ListVirtualMachineScaleSetIPConfigurations response. +func (client *InterfacesClient) listVirtualMachineScaleSetIPConfigurationsHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse, error) { + result := InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceIPConfigurationListResult); err != nil { + return InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse{}, err + } + return result, nil +} + +// NewListVirtualMachineScaleSetNetworkInterfacesPager - Gets all network interfaces in a virtual machine scale set. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - options - InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager +// method. +func (client *InterfacesClient) NewListVirtualMachineScaleSetNetworkInterfacesPager(resourceGroupName string, virtualMachineScaleSetName string, options *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse]{ + More: func(page InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse) (InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, runtime.NewResponseError(resp) + } + return client.listVirtualMachineScaleSetNetworkInterfacesHandleResponse(resp) + }, + }) +} + +// listVirtualMachineScaleSetNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetNetworkInterfaces request. +func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + 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", "2018-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachineScaleSetNetworkInterfacesHandleResponse handles the ListVirtualMachineScaleSetNetworkInterfaces response. +func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse, error) { + result := InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse{}, err + } + return result, nil +} + +// NewListVirtualMachineScaleSetVMNetworkInterfacesPager - Gets information about all network interfaces in a virtual machine +// in a virtual machine scale set. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - options - InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions contains the optional parameters for the +// InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager method. +func (client *InterfacesClient) NewListVirtualMachineScaleSetVMNetworkInterfacesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) *runtime.Pager[InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse]{ + More: func(page InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse) (InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, runtime.NewResponseError(resp) + } + return client.listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse(resp) + }, + }) +} + +// listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetVMNetworkInterfaces request. +func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + 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", "2018-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse handles the ListVirtualMachineScaleSetVMNetworkInterfaces response. +func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesHandleResponse(resp *http.Response) (InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse, error) { + result := InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a network interface tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - parameters - Parameters supplied to update network interface tags. +// - options - InterfacesClientUpdateTagsOptions contains the optional parameters for the InterfacesClient.UpdateTags method. +func (client *InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject, options *InterfacesClientUpdateTagsOptions) (InterfacesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkInterfaceName, parameters, options) + if err != nil { + return InterfacesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfacesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfacesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject, options *InterfacesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *InterfacesClient) updateTagsHandleResponse(resp *http.Response) (InterfacesClientUpdateTagsResponse, error) { + result := InterfacesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return InterfacesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfacetapconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfacetapconfigurations_client.go new file mode 100644 index 00000000000..59818413bda --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/interfacetapconfigurations_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// InterfaceTapConfigurationsClient contains the methods for the NetworkInterfaceTapConfigurations group. +// Don't use this type directly, use NewInterfaceTapConfigurationsClient() instead. +type InterfaceTapConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInterfaceTapConfigurationsClient creates a new instance of InterfaceTapConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInterfaceTapConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InterfaceTapConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".InterfaceTapConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InterfaceTapConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - tapConfigurationName - The name of the tap configuration. +// - tapConfigurationParameters - Parameters supplied to the create or update tap configuration operation. +// - options - InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate +// method. +func (client *InterfaceTapConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InterfaceTapConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfaceTapConfigurationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfaceTapConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a Tap configuration in the specified NetworkInterface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfaceTapConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if tapConfigurationName == "" { + return nil, errors.New("parameter tapConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, tapConfigurationParameters) +} + +// BeginDelete - Deletes the specified tap configuration from the NetworkInterface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - tapConfigurationName - The name of the tap configuration. +// - options - InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete +// method. +func (client *InterfaceTapConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*runtime.Poller[InterfaceTapConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InterfaceTapConfigurationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InterfaceTapConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified tap configuration from the NetworkInterface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *InterfaceTapConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if tapConfigurationName == "" { + return nil, errors.New("parameter tapConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the specified tap configuration on a network interface. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - tapConfigurationName - The name of the tap configuration. +// - options - InterfaceTapConfigurationsClientGetOptions contains the optional parameters for the InterfaceTapConfigurationsClient.Get +// method. +func (client *InterfaceTapConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientGetOptions) (InterfaceTapConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, options) + if err != nil { + return InterfaceTapConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfaceTapConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfaceTapConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, options *InterfaceTapConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if tapConfigurationName == "" { + return nil, errors.New("parameter tapConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapConfigurationName}", url.PathEscape(tapConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Response) (InterfaceTapConfigurationsClientGetResponse, error) { + result := InterfaceTapConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceTapConfiguration); err != nil { + return InterfaceTapConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all Tap configurations in a network interface. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkInterfaceName - The name of the network interface. +// - options - InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.NewListPager +// method. +func (client *InterfaceTapConfigurationsClient) NewListPager(resourceGroupName string, networkInterfaceName string, options *InterfaceTapConfigurationsClientListOptions) *runtime.Pager[InterfaceTapConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InterfaceTapConfigurationsClientListResponse]{ + More: func(page InterfaceTapConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InterfaceTapConfigurationsClientListResponse) (InterfaceTapConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkInterfaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InterfaceTapConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InterfaceTapConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InterfaceTapConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceTapConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InterfaceTapConfigurationsClient) listHandleResponse(resp *http.Response) (InterfaceTapConfigurationsClientListResponse, error) { + result := InterfaceTapConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceTapConfigurationListResult); err != nil { + return InterfaceTapConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipallocations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipallocations_client.go new file mode 100644 index 00000000000..a629a748c83 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipallocations_client.go @@ -0,0 +1,424 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// IPAllocationsClient contains the methods for the IPAllocations group. +// Don't use this type directly, use NewIPAllocationsClient() instead. +type IPAllocationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewIPAllocationsClient creates a new instance of IPAllocationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewIPAllocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPAllocationsClient, error) { + cl, err := arm.NewClient(moduleName+".IPAllocationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &IPAllocationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipAllocationName - The name of the IpAllocation. +// - parameters - Parameters supplied to the create or update virtual network operation. +// - options - IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate +// method. +func (client *IPAllocationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IPAllocationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, ipAllocationName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPAllocationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[IPAllocationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an IpAllocation in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *IPAllocationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ipAllocationName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters IPAllocation, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipAllocationName == "" { + return nil, errors.New("parameter ipAllocationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified IpAllocation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipAllocationName - The name of the IpAllocation. +// - options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete +// method. +func (client *IPAllocationsClient) BeginDelete(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*runtime.Poller[IPAllocationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, ipAllocationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPAllocationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[IPAllocationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified IpAllocation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipAllocationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipAllocationName == "" { + return nil, errors.New("parameter ipAllocationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified IpAllocation by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipAllocationName - The name of the IpAllocation. +// - options - IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. +func (client *IPAllocationsClient) Get(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (IPAllocationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, ipAllocationName, options) + if err != nil { + return IPAllocationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPAllocationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPAllocationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipAllocationName == "" { + return nil, errors.New("parameter ipAllocationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAllocationsClientGetResponse, error) { + result := IPAllocationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocation); err != nil { + return IPAllocationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all IpAllocations in a subscription. +// +// Generated from API version 2022-09-01 +// - options - IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.NewListPager method. +func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientListOptions) *runtime.Pager[IPAllocationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListResponse]{ + More: func(page IPAllocationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *IPAllocationsClientListResponse) (IPAllocationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IPAllocationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPAllocationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPAllocationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, options *IPAllocationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAllocationsClientListResponse, error) { + result := IPAllocationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil { + return IPAllocationsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all IpAllocations in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager +// method. +func (client *IPAllocationsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) *runtime.Pager[IPAllocationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListByResourceGroupResponse]{ + More: func(page IPAllocationsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *IPAllocationsClientListByResourceGroupResponse) (IPAllocationsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IPAllocationsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPAllocationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPAllocationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *IPAllocationsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPAllocationsClientListByResourceGroupResponse, error) { + result := IPAllocationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocationListResult); err != nil { + return IPAllocationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a IpAllocation tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipAllocationName - The name of the IpAllocation. +// - parameters - Parameters supplied to update IpAllocation tags. +// - options - IPAllocationsClientUpdateTagsOptions contains the optional parameters for the IPAllocationsClient.UpdateTags +// method. +func (client *IPAllocationsClient) UpdateTags(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters TagsObject, options *IPAllocationsClientUpdateTagsOptions) (IPAllocationsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, ipAllocationName, parameters, options) + if err != nil { + return IPAllocationsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPAllocationsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPAllocationsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, parameters TagsObject, options *IPAllocationsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipAllocationName == "" { + return nil, errors.New("parameter ipAllocationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipAllocationName}", url.PathEscape(ipAllocationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *IPAllocationsClient) updateTagsHandleResponse(resp *http.Response) (IPAllocationsClientUpdateTagsResponse, error) { + result := IPAllocationsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPAllocation); err != nil { + return IPAllocationsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipgroups_client.go new file mode 100644 index 00000000000..f1135d06a53 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/ipgroups_client.go @@ -0,0 +1,422 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// IPGroupsClient contains the methods for the IPGroups group. +// Don't use this type directly, use NewIPGroupsClient() instead. +type IPGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewIPGroupsClient creates a new instance of IPGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewIPGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".IPGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &IPGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an ipGroups in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipGroupsName - The name of the ipGroups. +// - parameters - Parameters supplied to the create or update IpGroups operation. +// - options - IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate +// method. +func (client *IPGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IPGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, ipGroupsName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[IPGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an ipGroups in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *IPGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ipGroupsName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters IPGroup, options *IPGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipGroupsName == "" { + return nil, errors.New("parameter ipGroupsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified ipGroups. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipGroupsName - The name of the ipGroups. +// - options - IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. +func (client *IPGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*runtime.Poller[IPGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, ipGroupsName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[IPGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified ipGroups. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipGroupsName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipGroupsName == "" { + return nil, errors.New("parameter ipGroupsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified ipGroups. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipGroupsName - The name of the ipGroups. +// - options - IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. +func (client *IPGroupsClient) Get(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (IPGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, ipGroupsName, options) + if err != nil { + return IPGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipGroupsName == "" { + return nil, errors.New("parameter ipGroupsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsClientGetResponse, error) { + result := IPGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPGroup); err != nil { + return IPGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all IpGroups in a subscription. +// +// Generated from API version 2022-09-01 +// - options - IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.NewListPager method. +func (client *IPGroupsClient) NewListPager(options *IPGroupsClientListOptions) *runtime.Pager[IPGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListResponse]{ + More: func(page IPGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *IPGroupsClientListResponse) (IPGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IPGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IPGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsClientListResponse, error) { + result := IPGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPGroupListResult); err != nil { + return IPGroupsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all IpGroups in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager +// method. +func (client *IPGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) *runtime.Pager[IPGroupsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[IPGroupsClientListByResourceGroupResponse]{ + More: func(page IPGroupsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *IPGroupsClientListByResourceGroupResponse) (IPGroupsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IPGroupsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPGroupsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *IPGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (IPGroupsClientListByResourceGroupResponse, error) { + result := IPGroupsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPGroupListResult); err != nil { + return IPGroupsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateGroups - Updates tags of an IpGroups resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - ipGroupsName - The name of the ipGroups. +// - parameters - Parameters supplied to the update ipGroups operation. +// - options - IPGroupsClientUpdateGroupsOptions contains the optional parameters for the IPGroupsClient.UpdateGroups method. +func (client *IPGroupsClient) UpdateGroups(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters TagsObject, options *IPGroupsClientUpdateGroupsOptions) (IPGroupsClientUpdateGroupsResponse, error) { + req, err := client.updateGroupsCreateRequest(ctx, resourceGroupName, ipGroupsName, parameters, options) + if err != nil { + return IPGroupsClientUpdateGroupsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IPGroupsClientUpdateGroupsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPGroupsClientUpdateGroupsResponse{}, runtime.NewResponseError(resp) + } + return client.updateGroupsHandleResponse(resp) +} + +// updateGroupsCreateRequest creates the UpdateGroups request. +func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, parameters TagsObject, options *IPGroupsClientUpdateGroupsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if ipGroupsName == "" { + return nil, errors.New("parameter ipGroupsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipGroupsName}", url.PathEscape(ipGroupsName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateGroupsHandleResponse handles the UpdateGroups response. +func (client *IPGroupsClient) updateGroupsHandleResponse(resp *http.Response) (IPGroupsClientUpdateGroupsResponse, error) { + result := IPGroupsClientUpdateGroupsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPGroup); err != nil { + return IPGroupsClientUpdateGroupsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerbackendaddresspools_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerbackendaddresspools_client.go new file mode 100644 index 00000000000..5f16f4a96da --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerbackendaddresspools_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerBackendAddressPoolsClient contains the methods for the LoadBalancerBackendAddressPools group. +// Don't use this type directly, use NewLoadBalancerBackendAddressPoolsClient() instead. +type LoadBalancerBackendAddressPoolsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerBackendAddressPoolsClient creates a new instance of LoadBalancerBackendAddressPoolsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerBackendAddressPoolsClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerBackendAddressPoolsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerBackendAddressPoolsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a load balancer backend address pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - backendAddressPoolName - The name of the backend address pool. +// - parameters - Parameters supplied to the create or update load balancer backend address pool operation. +// - options - LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate +// method. +func (client *LoadBalancerBackendAddressPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a load balancer backend address pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if backendAddressPoolName == "" { + return nil, errors.New("parameter backendAddressPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified load balancer backend address pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - backendAddressPoolName - The name of the backend address pool. +// - options - LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete +// method. +func (client *LoadBalancerBackendAddressPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*runtime.Poller[LoadBalancerBackendAddressPoolsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancerBackendAddressPoolsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancerBackendAddressPoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified load balancer backend address pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if backendAddressPoolName == "" { + return nil, errors.New("parameter backendAddressPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets load balancer backend address pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - backendAddressPoolName - The name of the backend address pool. +// - options - LoadBalancerBackendAddressPoolsClientGetOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.Get +// method. +func (client *LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientGetOptions) (LoadBalancerBackendAddressPoolsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, options) + if err != nil { + return LoadBalancerBackendAddressPoolsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerBackendAddressPoolsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerBackendAddressPoolsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if backendAddressPoolName == "" { + return nil, errors.New("parameter backendAddressPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backendAddressPoolName}", url.PathEscape(backendAddressPoolName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *http.Response) (LoadBalancerBackendAddressPoolsClientGetResponse, error) { + result := LoadBalancerBackendAddressPoolsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackendAddressPool); err != nil { + return LoadBalancerBackendAddressPoolsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the load balancer backed address pools. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.NewListPager +// method. +func (client *LoadBalancerBackendAddressPoolsClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerBackendAddressPoolsClientListOptions) *runtime.Pager[LoadBalancerBackendAddressPoolsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerBackendAddressPoolsClientListResponse]{ + More: func(page LoadBalancerBackendAddressPoolsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerBackendAddressPoolsClientListResponse) (LoadBalancerBackendAddressPoolsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerBackendAddressPoolsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerBackendAddressPoolsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerBackendAddressPoolsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerBackendAddressPoolsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerBackendAddressPoolsClient) listHandleResponse(resp *http.Response) (LoadBalancerBackendAddressPoolsClientListResponse, error) { + result := LoadBalancerBackendAddressPoolsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerBackendAddressPoolListResult); err != nil { + return LoadBalancerBackendAddressPoolsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerfrontendipconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerfrontendipconfigurations_client.go new file mode 100644 index 00000000000..38c18105901 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerfrontendipconfigurations_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerFrontendIPConfigurationsClient contains the methods for the LoadBalancerFrontendIPConfigurations group. +// Don't use this type directly, use NewLoadBalancerFrontendIPConfigurationsClient() instead. +type LoadBalancerFrontendIPConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerFrontendIPConfigurationsClient creates a new instance of LoadBalancerFrontendIPConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerFrontendIPConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerFrontendIPConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerFrontendIPConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets load balancer frontend IP configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - frontendIPConfigurationName - The name of the frontend IP configuration. +// - options - LoadBalancerFrontendIPConfigurationsClientGetOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.Get +// method. +func (client *LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (LoadBalancerFrontendIPConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName, options) + if err != nil { + return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if frontendIPConfigurationName == "" { + return nil, errors.New("parameter frontendIPConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{frontendIPConfigurationName}", url.PathEscape(frontendIPConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancerFrontendIPConfigurationsClient) getHandleResponse(resp *http.Response) (LoadBalancerFrontendIPConfigurationsClientGetResponse, error) { + result := LoadBalancerFrontendIPConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FrontendIPConfiguration); err != nil { + return LoadBalancerFrontendIPConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the load balancer frontend IP configurations. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.NewListPager +// method. +func (client *LoadBalancerFrontendIPConfigurationsClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerFrontendIPConfigurationsClientListOptions) *runtime.Pager[LoadBalancerFrontendIPConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerFrontendIPConfigurationsClientListResponse]{ + More: func(page LoadBalancerFrontendIPConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerFrontendIPConfigurationsClientListResponse) (LoadBalancerFrontendIPConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerFrontendIPConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerFrontendIPConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerFrontendIPConfigurationsClient) listHandleResponse(resp *http.Response) (LoadBalancerFrontendIPConfigurationsClientListResponse, error) { + result := LoadBalancerFrontendIPConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerFrontendIPConfigurationListResult); err != nil { + return LoadBalancerFrontendIPConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerloadbalancingrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerloadbalancingrules_client.go new file mode 100644 index 00000000000..ca40f46b6ed --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerloadbalancingrules_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerLoadBalancingRulesClient contains the methods for the LoadBalancerLoadBalancingRules group. +// Don't use this type directly, use NewLoadBalancerLoadBalancingRulesClient() instead. +type LoadBalancerLoadBalancingRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerLoadBalancingRulesClient creates a new instance of LoadBalancerLoadBalancingRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerLoadBalancingRulesClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerLoadBalancingRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerLoadBalancingRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified load balancer load balancing rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - loadBalancingRuleName - The name of the load balancing rule. +// - options - LoadBalancerLoadBalancingRulesClientGetOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.Get +// method. +func (client *LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientGetOptions) (LoadBalancerLoadBalancingRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName, options) + if err != nil { + return LoadBalancerLoadBalancingRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerLoadBalancingRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerLoadBalancingRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string, options *LoadBalancerLoadBalancingRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if loadBalancingRuleName == "" { + return nil, errors.New("parameter loadBalancingRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancingRuleName}", url.PathEscape(loadBalancingRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancerLoadBalancingRulesClient) getHandleResponse(resp *http.Response) (LoadBalancerLoadBalancingRulesClientGetResponse, error) { + result := LoadBalancerLoadBalancingRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancingRule); err != nil { + return LoadBalancerLoadBalancingRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the load balancing rules in a load balancer. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.NewListPager +// method. +func (client *LoadBalancerLoadBalancingRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerLoadBalancingRulesClientListOptions) *runtime.Pager[LoadBalancerLoadBalancingRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerLoadBalancingRulesClientListResponse]{ + More: func(page LoadBalancerLoadBalancingRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerLoadBalancingRulesClientListResponse) (LoadBalancerLoadBalancingRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerLoadBalancingRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerLoadBalancingRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerLoadBalancingRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerLoadBalancingRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerLoadBalancingRulesClient) listHandleResponse(resp *http.Response) (LoadBalancerLoadBalancingRulesClientListResponse, error) { + result := LoadBalancerLoadBalancingRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerLoadBalancingRuleListResult); err != nil { + return LoadBalancerLoadBalancingRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancernetworkinterfaces_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancernetworkinterfaces_client.go new file mode 100644 index 00000000000..39acf075b03 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancernetworkinterfaces_client.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerNetworkInterfacesClient contains the methods for the LoadBalancerNetworkInterfaces group. +// Don't use this type directly, use NewLoadBalancerNetworkInterfacesClient() instead. +type LoadBalancerNetworkInterfacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerNetworkInterfacesClient creates a new instance of LoadBalancerNetworkInterfacesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerNetworkInterfacesClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerNetworkInterfacesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerNetworkInterfacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets associated load balancer network interfaces. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.NewListPager +// method. +func (client *LoadBalancerNetworkInterfacesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerNetworkInterfacesClientListOptions) *runtime.Pager[LoadBalancerNetworkInterfacesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerNetworkInterfacesClientListResponse]{ + More: func(page LoadBalancerNetworkInterfacesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerNetworkInterfacesClientListResponse) (LoadBalancerNetworkInterfacesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerNetworkInterfacesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerNetworkInterfacesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerNetworkInterfacesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerNetworkInterfacesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerNetworkInterfacesClient) listHandleResponse(resp *http.Response) (LoadBalancerNetworkInterfacesClientListResponse, error) { + result := LoadBalancerNetworkInterfacesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InterfaceListResult); err != nil { + return LoadBalancerNetworkInterfacesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalanceroutboundrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalanceroutboundrules_client.go new file mode 100644 index 00000000000..0deea06b898 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalanceroutboundrules_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerOutboundRulesClient contains the methods for the LoadBalancerOutboundRules group. +// Don't use this type directly, use NewLoadBalancerOutboundRulesClient() instead. +type LoadBalancerOutboundRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerOutboundRulesClient creates a new instance of LoadBalancerOutboundRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerOutboundRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerOutboundRulesClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerOutboundRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerOutboundRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified load balancer outbound rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - outboundRuleName - The name of the outbound rule. +// - options - LoadBalancerOutboundRulesClientGetOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.Get +// method. +func (client *LoadBalancerOutboundRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string, options *LoadBalancerOutboundRulesClientGetOptions) (LoadBalancerOutboundRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, outboundRuleName, options) + if err != nil { + return LoadBalancerOutboundRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerOutboundRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerOutboundRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string, options *LoadBalancerOutboundRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if outboundRuleName == "" { + return nil, errors.New("parameter outboundRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{outboundRuleName}", url.PathEscape(outboundRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancerOutboundRulesClient) getHandleResponse(resp *http.Response) (LoadBalancerOutboundRulesClientGetResponse, error) { + result := LoadBalancerOutboundRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundRule); err != nil { + return LoadBalancerOutboundRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the outbound rules in a load balancer. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.NewListPager +// method. +func (client *LoadBalancerOutboundRulesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerOutboundRulesClientListOptions) *runtime.Pager[LoadBalancerOutboundRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerOutboundRulesClientListResponse]{ + More: func(page LoadBalancerOutboundRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerOutboundRulesClientListResponse) (LoadBalancerOutboundRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerOutboundRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerOutboundRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerOutboundRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerOutboundRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerOutboundRulesClient) listHandleResponse(resp *http.Response) (LoadBalancerOutboundRulesClientListResponse, error) { + result := LoadBalancerOutboundRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerOutboundRuleListResult); err != nil { + return LoadBalancerOutboundRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerprobes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerprobes_client.go new file mode 100644 index 00000000000..bfa80c7ca60 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancerprobes_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancerProbesClient contains the methods for the LoadBalancerProbes group. +// Don't use this type directly, use NewLoadBalancerProbesClient() instead. +type LoadBalancerProbesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancerProbesClient creates a new instance of LoadBalancerProbesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancerProbesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancerProbesClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancerProbesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancerProbesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets load balancer probe. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - probeName - The name of the probe. +// - options - LoadBalancerProbesClientGetOptions contains the optional parameters for the LoadBalancerProbesClient.Get method. +func (client *LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string, options *LoadBalancerProbesClientGetOptions) (LoadBalancerProbesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, probeName, options) + if err != nil { + return LoadBalancerProbesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerProbesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerProbesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string, options *LoadBalancerProbesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if probeName == "" { + return nil, errors.New("parameter probeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{probeName}", url.PathEscape(probeName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancerProbesClient) getHandleResponse(resp *http.Response) (LoadBalancerProbesClientGetResponse, error) { + result := LoadBalancerProbesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Probe); err != nil { + return LoadBalancerProbesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the load balancer probes. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.NewListPager +// method. +func (client *LoadBalancerProbesClient) NewListPager(resourceGroupName string, loadBalancerName string, options *LoadBalancerProbesClientListOptions) *runtime.Pager[LoadBalancerProbesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancerProbesClientListResponse]{ + More: func(page LoadBalancerProbesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancerProbesClientListResponse) (LoadBalancerProbesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancerProbesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancerProbesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancerProbesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerProbesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancerProbesClient) listHandleResponse(resp *http.Response) (LoadBalancerProbesClientListResponse, error) { + result := LoadBalancerProbesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerProbeListResult); err != nil { + return LoadBalancerProbesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancers_client.go new file mode 100644 index 00000000000..9060535fef9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/loadbalancers_client.go @@ -0,0 +1,560 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LoadBalancersClient contains the methods for the LoadBalancers group. +// Don't use this type directly, use NewLoadBalancersClient() instead. +type LoadBalancersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancersClient creates a new instance of LoadBalancersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancersClient, error) { + cl, err := arm.NewClient(moduleName+".LoadBalancersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - parameters - Parameters supplied to the create or update load balancer operation. +// - options - LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate +// method. +func (client *LoadBalancersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*runtime.Poller[LoadBalancersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, loadBalancerName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancersClient) createOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, loadBalancerName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete +// method. +func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, loadBalancerName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, loadBalancerName, options) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadBalancersClientGetResponse, error) { + result := LoadBalancersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the load balancers in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.NewListPager method. +func (client *LoadBalancersClient) NewListPager(resourceGroupName string, options *LoadBalancersClientListOptions) *runtime.Pager[LoadBalancersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListResponse]{ + More: func(page LoadBalancersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancersClientListResponse) (LoadBalancersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LoadBalancersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (LoadBalancersClientListResponse, error) { + result := LoadBalancersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { + return LoadBalancersClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the load balancers in a subscription. +// +// Generated from API version 2022-09-01 +// - options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager +// method. +func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListAllResponse]{ + More: func(page LoadBalancersClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancersClientListAllResponse) (LoadBalancersClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LoadBalancersClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancersClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, options *LoadBalancersClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *LoadBalancersClient) listAllHandleResponse(resp *http.Response) (LoadBalancersClientListAllResponse, error) { + result := LoadBalancersClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { + return LoadBalancersClientListAllResponse{}, err + } + return result, nil +} + +// BeginListInboundNatRulePortMappings - List of inbound NAT rule port mappings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - groupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - backendPoolName - The name of the load balancer backend address pool. +// - parameters - Query inbound NAT rule port mapping request. +// - options - LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings +// method. +func (client *LoadBalancersClient) BeginListInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*runtime.Poller[LoadBalancersClientListInboundNatRulePortMappingsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listInboundNatRulePortMappings(ctx, groupName, loadBalancerName, backendPoolName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientListInboundNatRulePortMappingsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancersClientListInboundNatRulePortMappingsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListInboundNatRulePortMappings - List of inbound NAT rule port mappings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancersClient) listInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*http.Response, error) { + req, err := client.listInboundNatRulePortMappingsCreateRequest(ctx, groupName, loadBalancerName, backendPoolName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listInboundNatRulePortMappingsCreateRequest creates the ListInboundNatRulePortMappings request. +func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping" + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + if backendPoolName == "" { + return nil, errors.New("parameter backendPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backendPoolName}", url.PathEscape(backendPoolName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginSwapPublicIPAddresses - Swaps VIPs between two load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The region where load balancers are located at. +// - parameters - Parameters that define which VIPs should be swapped. +// - options - LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses +// method. +func (client *LoadBalancersClient) BeginSwapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*runtime.Poller[LoadBalancersClientSwapPublicIPAddressesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.swapPublicIPAddresses(ctx, location, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientSwapPublicIPAddressesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LoadBalancersClientSwapPublicIPAddressesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// SwapPublicIPAddresses - Swaps VIPs between two load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { + req, err := client.swapPublicIPAddressesCreateRequest(ctx, location, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// swapPublicIPAddressesCreateRequest creates the SwapPublicIPAddresses request. +func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// UpdateTags - Updates a load balancer tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - loadBalancerName - The name of the load balancer. +// - parameters - Parameters supplied to update load balancer tags. +// - options - LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags +// method. +func (client *LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject, options *LoadBalancersClientUpdateTagsOptions) (LoadBalancersClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, loadBalancerName, parameters, options) + if err != nil { + return LoadBalancersClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LoadBalancersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject, options *LoadBalancersClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *LoadBalancersClient) updateTagsHandleResponse(resp *http.Response) (LoadBalancersClientUpdateTagsResponse, error) { + result := LoadBalancersClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/localnetworkgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/localnetworkgateways_client.go new file mode 100644 index 00000000000..b6dd37d9be8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/localnetworkgateways_client.go @@ -0,0 +1,363 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// LocalNetworkGatewaysClient contains the methods for the LocalNetworkGateways group. +// Don't use this type directly, use NewLocalNetworkGatewaysClient() instead. +type LocalNetworkGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLocalNetworkGatewaysClient creates a new instance of LocalNetworkGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLocalNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalNetworkGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".LocalNetworkGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LocalNetworkGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a local network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - localNetworkGatewayName - The name of the local network gateway. +// - parameters - Parameters supplied to the create or update local network gateway operation. +// - options - LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate +// method. +func (client *LocalNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[LocalNetworkGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalNetworkGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalNetworkGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a local network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LocalNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if localNetworkGatewayName == "" { + return nil, errors.New("parameter localNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified local network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - localNetworkGatewayName - The name of the local network gateway. +// - options - LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete +// method. +func (client *LocalNetworkGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*runtime.Poller[LocalNetworkGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalNetworkGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalNetworkGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified local network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if localNetworkGatewayName == "" { + return nil, errors.New("parameter localNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified local network gateway in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - localNetworkGatewayName - The name of the local network gateway. +// - options - LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get +// method. +func (client *LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientGetOptions) (LocalNetworkGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, options) + if err != nil { + return LocalNetworkGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalNetworkGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalNetworkGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if localNetworkGatewayName == "" { + return nil, errors.New("parameter localNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientGetResponse, error) { + result := LocalNetworkGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGateway); err != nil { + return LocalNetworkGatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the local network gateways in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager +// method. +func (client *LocalNetworkGatewaysClient) NewListPager(resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) *runtime.Pager[LocalNetworkGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LocalNetworkGatewaysClientListResponse]{ + More: func(page LocalNetworkGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LocalNetworkGatewaysClientListResponse) (LocalNetworkGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LocalNetworkGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalNetworkGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalNetworkGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LocalNetworkGatewaysClient) listHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientListResponse, error) { + result := LocalNetworkGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGatewayListResult); err != nil { + return LocalNetworkGatewaysClientListResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a local network gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - localNetworkGatewayName - The name of the local network gateway. +// - parameters - Parameters supplied to update local network gateway tags. +// - options - LocalNetworkGatewaysClientUpdateTagsOptions contains the optional parameters for the LocalNetworkGatewaysClient.UpdateTags +// method. +func (client *LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject, options *LocalNetworkGatewaysClientUpdateTagsOptions) (LocalNetworkGatewaysClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, localNetworkGatewayName, parameters, options) + if err != nil { + return LocalNetworkGatewaysClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalNetworkGatewaysClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalNetworkGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject, options *LocalNetworkGatewaysClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if localNetworkGatewayName == "" { + return nil, errors.New("parameter localNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localNetworkGatewayName}", url.PathEscape(localNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *LocalNetworkGatewaysClient) updateTagsHandleResponse(resp *http.Response) (LocalNetworkGatewaysClientUpdateTagsResponse, error) { + result := LocalNetworkGatewaysClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalNetworkGateway); err != nil { + return LocalNetworkGatewaysClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/management_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/management_client.go new file mode 100644 index 00000000000..479c688fd57 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/management_client.go @@ -0,0 +1,935 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ManagementClient contains the methods for the NetworkManagementClient group. +// Don't use this type directly, use NewManagementClient() instead. +type ManagementClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagementClient creates a new instance of ManagementClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) { + cl, err := arm.NewClient(moduleName+".ManagementClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagementClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckDNSNameAvailability - Checks whether a domain name in the cloudapp.azure.com zone is available for use. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - domainNameLabel - The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. +// - options - ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability +// method. +func (client *ManagementClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (ManagementClientCheckDNSNameAvailabilityResponse, error) { + req, err := client.checkDNSNameAvailabilityCreateRequest(ctx, location, domainNameLabel, options) + if err != nil { + return ManagementClientCheckDNSNameAvailabilityResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientCheckDNSNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientCheckDNSNameAvailabilityResponse{}, runtime.NewResponseError(resp) + } + return client.checkDNSNameAvailabilityHandleResponse(resp) +} + +// checkDNSNameAvailabilityCreateRequest creates the CheckDNSNameAvailability request. +func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability" + 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("domainNameLabel", domainNameLabel) + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// checkDNSNameAvailabilityHandleResponse handles the CheckDNSNameAvailability response. +func (client *ManagementClient) checkDNSNameAvailabilityHandleResponse(resp *http.Response) (ManagementClientCheckDNSNameAvailabilityResponse, error) { + result := ManagementClientCheckDNSNameAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DNSNameAvailabilityResult); err != nil { + return ManagementClientCheckDNSNameAvailabilityResponse{}, err + } + return result, nil +} + +// BeginDeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - bslRequest - Post request for all the Bastion Shareable Link endpoints. +// - options - ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink +// method. +func (client *ManagementClient) BeginDeleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*runtime.Poller[ManagementClientDeleteBastionShareableLinkResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagementClientDeleteBastionShareableLinkResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagementClientDeleteBastionShareableLinkResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DeleteBastionShareableLink - Deletes the Bastion Shareable Links for all the VMs specified in the request. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ManagementClient) deleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*http.Response, error) { + req, err := client.deleteBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteBastionShareableLinkCreateRequest creates the DeleteBastionShareableLink request. +func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, bslRequest) +} + +// NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - sessionIDs - The list of sessionids to disconnect. +// - options - ManagementClientDisconnectActiveSessionsOptions contains the optional parameters for the ManagementClient.NewDisconnectActiveSessionsPager +// method. +func (client *ManagementClient) NewDisconnectActiveSessionsPager(resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, options *ManagementClientDisconnectActiveSessionsOptions) *runtime.Pager[ManagementClientDisconnectActiveSessionsResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagementClientDisconnectActiveSessionsResponse]{ + More: func(page ManagementClientDisconnectActiveSessionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagementClientDisconnectActiveSessionsResponse) (ManagementClientDisconnectActiveSessionsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.disconnectActiveSessionsCreateRequest(ctx, resourceGroupName, bastionHostName, sessionIDs, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementClientDisconnectActiveSessionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientDisconnectActiveSessionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientDisconnectActiveSessionsResponse{}, runtime.NewResponseError(resp) + } + return client.disconnectActiveSessionsHandleResponse(resp) + }, + }) +} + +// disconnectActiveSessionsCreateRequest creates the DisconnectActiveSessions request. +func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, options *ManagementClientDisconnectActiveSessionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sessionIDs) +} + +// disconnectActiveSessionsHandleResponse handles the DisconnectActiveSessions response. +func (client *ManagementClient) disconnectActiveSessionsHandleResponse(resp *http.Response) (ManagementClientDisconnectActiveSessionsResponse, error) { + result := ManagementClientDisconnectActiveSessionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionSessionDeleteResult); err != nil { + return ManagementClientDisconnectActiveSessionsResponse{}, err + } + return result, nil +} + +// ExpressRouteProviderPort - Retrieves detail of a provider port. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - providerport - The name of the provider port. +// - options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort +// method. +func (client *ManagementClient) ExpressRouteProviderPort(ctx context.Context, providerport string, options *ManagementClientExpressRouteProviderPortOptions) (ManagementClientExpressRouteProviderPortResponse, error) { + req, err := client.expressRouteProviderPortCreateRequest(ctx, providerport, options) + if err != nil { + return ManagementClientExpressRouteProviderPortResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientExpressRouteProviderPortResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientExpressRouteProviderPortResponse{}, runtime.NewResponseError(resp) + } + return client.expressRouteProviderPortHandleResponse(resp) +} + +// expressRouteProviderPortCreateRequest creates the ExpressRouteProviderPort request. +func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx context.Context, providerport string, options *ManagementClientExpressRouteProviderPortOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}" + if providerport == "" { + return nil, errors.New("parameter providerport cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerport}", url.PathEscape(providerport)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// expressRouteProviderPortHandleResponse handles the ExpressRouteProviderPort response. +func (client *ManagementClient) expressRouteProviderPortHandleResponse(resp *http.Response) (ManagementClientExpressRouteProviderPortResponse, error) { + result := ManagementClientExpressRouteProviderPortResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteProviderPort); err != nil { + return ManagementClientExpressRouteProviderPortResponse{}, err + } + return result, nil +} + +// BeginGeneratevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan +// and associated VpnServerConfiguration combination in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name. +// - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. +// - vpnClientParams - Parameters supplied to the generate VirtualWan VPN profile generation operation. +// - options - ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters +// for the ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. +func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*runtime.Poller[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.generatevirtualwanvpnserverconfigurationvpnprofile(ctx, resourceGroupName, virtualWANName, vpnClientParams, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Generatevirtualwanvpnserverconfigurationvpnprofile - Generates a unique VPN profile for P2S clients for VirtualWan and +// associated VpnServerConfiguration combination in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*http.Response, error) { + req, err := client.generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx, resourceGroupName, virtualWANName, vpnClientParams, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest creates the Generatevirtualwanvpnserverconfigurationvpnprofile request. +func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnClientParams) +} + +// BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - options - ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions +// method. +func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*runtime.Poller[*runtime.Pager[ManagementClientGetActiveSessionsResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[ManagementClientGetActiveSessionsResponse]{ + More: func(page ManagementClientGetActiveSessionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagementClientGetActiveSessionsResponse) (ManagementClientGetActiveSessionsResponse, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + if err != nil { + return ManagementClientGetActiveSessionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientGetActiveSessionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientGetActiveSessionsResponse{}, runtime.NewResponseError(resp) + } + return client.getActiveSessionsHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.getActiveSessions(ctx, resourceGroupName, bastionHostName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[ManagementClientGetActiveSessionsResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[ManagementClientGetActiveSessionsResponse]]{ + Response: &pager, + }) + } +} + +// GetActiveSessions - Returns the list of currently active sessions on the Bastion. +// +// Generated from API version 2022-09-01 +func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { + req, err := client.getActiveSessionsCreateRequest(ctx, resourceGroupName, bastionHostName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getActiveSessionsCreateRequest creates the GetActiveSessions request. +func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getActiveSessionsHandleResponse handles the GetActiveSessions response. +func (client *ManagementClient) getActiveSessionsHandleResponse(resp *http.Response) (ManagementClientGetActiveSessionsResponse, error) { + result := ManagementClientGetActiveSessionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionActiveSessionListResult); err != nil { + return ManagementClientGetActiveSessionsResponse{}, err + } + return result, nil +} + +// NewGetBastionShareableLinkPager - Return the Bastion Shareable Links for all the VMs specified in the request. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - bslRequest - Post request for all the Bastion Shareable Link endpoints. +// - options - ManagementClientGetBastionShareableLinkOptions contains the optional parameters for the ManagementClient.NewGetBastionShareableLinkPager +// method. +func (client *ManagementClient) NewGetBastionShareableLinkPager(resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientGetBastionShareableLinkOptions) *runtime.Pager[ManagementClientGetBastionShareableLinkResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagementClientGetBastionShareableLinkResponse]{ + More: func(page ManagementClientGetBastionShareableLinkResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagementClientGetBastionShareableLinkResponse) (ManagementClientGetBastionShareableLinkResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.getBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementClientGetBastionShareableLinkResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientGetBastionShareableLinkResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientGetBastionShareableLinkResponse{}, runtime.NewResponseError(resp) + } + return client.getBastionShareableLinkHandleResponse(resp) + }, + }) +} + +// getBastionShareableLinkCreateRequest creates the GetBastionShareableLink request. +func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientGetBastionShareableLinkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, bslRequest) +} + +// getBastionShareableLinkHandleResponse handles the GetBastionShareableLink response. +func (client *ManagementClient) getBastionShareableLinkHandleResponse(resp *http.Response) (ManagementClientGetBastionShareableLinkResponse, error) { + result := ManagementClientGetBastionShareableLinkResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionShareableLinkListResult); err != nil { + return ManagementClientGetBastionShareableLinkResponse{}, err + } + return result, nil +} + +// ListActiveConnectivityConfigurations - Lists active connectivity configurations in a network manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Active Configuration Parameter. +// - options - ManagementClientListActiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListActiveConnectivityConfigurations +// method. +func (client *ManagementClient) ListActiveConnectivityConfigurations(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveConnectivityConfigurationsOptions) (ManagementClientListActiveConnectivityConfigurationsResponse, error) { + req, err := client.listActiveConnectivityConfigurationsCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return ManagementClientListActiveConnectivityConfigurationsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientListActiveConnectivityConfigurationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientListActiveConnectivityConfigurationsResponse{}, runtime.NewResponseError(resp) + } + return client.listActiveConnectivityConfigurationsHandleResponse(resp) +} + +// listActiveConnectivityConfigurationsCreateRequest creates the ListActiveConnectivityConfigurations request. +func (client *ManagementClient) listActiveConnectivityConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveConnectivityConfigurationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listActiveConnectivityConfigurationsHandleResponse handles the ListActiveConnectivityConfigurations response. +func (client *ManagementClient) listActiveConnectivityConfigurationsHandleResponse(resp *http.Response) (ManagementClientListActiveConnectivityConfigurationsResponse, error) { + result := ManagementClientListActiveConnectivityConfigurationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ActiveConnectivityConfigurationsListResult); err != nil { + return ManagementClientListActiveConnectivityConfigurationsResponse{}, err + } + return result, nil +} + +// ListActiveSecurityAdminRules - Lists active security admin rules in a network manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Active Configuration Parameter. +// - options - ManagementClientListActiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListActiveSecurityAdminRules +// method. +func (client *ManagementClient) ListActiveSecurityAdminRules(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveSecurityAdminRulesOptions) (ManagementClientListActiveSecurityAdminRulesResponse, error) { + req, err := client.listActiveSecurityAdminRulesCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return ManagementClientListActiveSecurityAdminRulesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientListActiveSecurityAdminRulesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientListActiveSecurityAdminRulesResponse{}, runtime.NewResponseError(resp) + } + return client.listActiveSecurityAdminRulesHandleResponse(resp) +} + +// listActiveSecurityAdminRulesCreateRequest creates the ListActiveSecurityAdminRules request. +func (client *ManagementClient) listActiveSecurityAdminRulesCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ActiveConfigurationParameter, options *ManagementClientListActiveSecurityAdminRulesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listActiveSecurityAdminRulesHandleResponse handles the ListActiveSecurityAdminRules response. +func (client *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp *http.Response) (ManagementClientListActiveSecurityAdminRulesResponse, error) { + result := ManagementClientListActiveSecurityAdminRulesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ActiveSecurityAdminRulesListResult); err != nil { + return ManagementClientListActiveSecurityAdminRulesResponse{}, err + } + return result, nil +} + +// ListNetworkManagerEffectiveConnectivityConfigurations - List all effective connectivity configurations applied on a virtual +// network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - parameters - Parameters supplied to list correct page. +// - options - ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions contains the optional parameters +// for the ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations method. +func (client *ManagementClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error) { + req, err := client.listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) + if err != nil { + return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, runtime.NewResponseError(resp) + } + return client.listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse(resp) +} + +// listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest creates the ListNetworkManagerEffectiveConnectivityConfigurations request. +func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations" + 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 virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse handles the ListNetworkManagerEffectiveConnectivityConfigurations response. +func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigurationsHandleResponse(resp *http.Response) (ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse, error) { + result := ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerEffectiveConnectivityConfigurationListResult); err != nil { + return ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse{}, err + } + return result, nil +} + +// ListNetworkManagerEffectiveSecurityAdminRules - List all effective security admin rules applied on a virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - parameters - Parameters supplied to list correct page. +// - options - ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions contains the optional parameters for the +// ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules method. +func (client *ManagementClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error) { + req, err := client.listNetworkManagerEffectiveSecurityAdminRulesCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) + if err != nil { + return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, runtime.NewResponseError(resp) + } + return client.listNetworkManagerEffectiveSecurityAdminRulesHandleResponse(resp) +} + +// listNetworkManagerEffectiveSecurityAdminRulesCreateRequest creates the ListNetworkManagerEffectiveSecurityAdminRules request. +func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters QueryRequestOptions, options *ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules" + 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 virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listNetworkManagerEffectiveSecurityAdminRulesHandleResponse handles the ListNetworkManagerEffectiveSecurityAdminRules response. +func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHandleResponse(resp *http.Response) (ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse, error) { + result := ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerEffectiveSecurityAdminRulesListResult); err != nil { + return ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse{}, err + } + return result, nil +} + +// BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - bastionHostName - The name of the Bastion Host. +// - bslRequest - Post request for all the Bastion Shareable Link endpoints. +// - options - ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink +// method. +func (client *ManagementClient) BeginPutBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*runtime.Poller[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[ManagementClientPutBastionShareableLinkResponse]{ + More: func(page ManagementClientPutBastionShareableLinkResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagementClientPutBastionShareableLinkResponse) (ManagementClientPutBastionShareableLinkResponse, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + if err != nil { + return ManagementClientPutBastionShareableLinkResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientPutBastionShareableLinkResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientPutBastionShareableLinkResponse{}, runtime.NewResponseError(resp) + } + return client.putBastionShareableLinkHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.putBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[ManagementClientPutBastionShareableLinkResponse]]{ + Response: &pager, + }) + } +} + +// PutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. +// +// Generated from API version 2022-09-01 +func (client *ManagementClient) putBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*http.Response, error) { + req, err := client.putBastionShareableLinkCreateRequest(ctx, resourceGroupName, bastionHostName, bslRequest, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// putBastionShareableLinkCreateRequest creates the PutBastionShareableLink request. +func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientBeginPutBastionShareableLinkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if bastionHostName == "" { + return nil, errors.New("parameter bastionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bastionHostName}", url.PathEscape(bastionHostName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, bslRequest) +} + +// putBastionShareableLinkHandleResponse handles the PutBastionShareableLink response. +func (client *ManagementClient) putBastionShareableLinkHandleResponse(resp *http.Response) (ManagementClientPutBastionShareableLinkResponse, error) { + result := ManagementClientPutBastionShareableLinkResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BastionShareableLinkListResult); err != nil { + return ManagementClientPutBastionShareableLinkResponse{}, err + } + return result, nil +} + +// SupportedSecurityProviders - Gives the supported security providers for the virtual wan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name. +// - virtualWANName - The name of the VirtualWAN for which supported security providers are needed. +// - options - ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders +// method. +func (client *ManagementClient) SupportedSecurityProviders(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (ManagementClientSupportedSecurityProvidersResponse, error) { + req, err := client.supportedSecurityProvidersCreateRequest(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return ManagementClientSupportedSecurityProvidersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementClientSupportedSecurityProvidersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementClientSupportedSecurityProvidersResponse{}, runtime.NewResponseError(resp) + } + return client.supportedSecurityProvidersHandleResponse(resp) +} + +// supportedSecurityProvidersCreateRequest creates the SupportedSecurityProviders request. +func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// supportedSecurityProvidersHandleResponse handles the SupportedSecurityProviders response. +func (client *ManagementClient) supportedSecurityProvidersHandleResponse(resp *http.Response) (ManagementClientSupportedSecurityProvidersResponse, error) { + result := ManagementClientSupportedSecurityProvidersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWanSecurityProviders); err != nil { + return ManagementClientSupportedSecurityProvidersResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managementgroupnetworkmanagerconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managementgroupnetworkmanagerconnections_client.go new file mode 100644 index 00000000000..af94b26e6e9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managementgroupnetworkmanagerconnections_client.go @@ -0,0 +1,264 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ManagementGroupNetworkManagerConnectionsClient contains the methods for the ManagementGroupNetworkManagerConnections group. +// Don't use this type directly, use NewManagementGroupNetworkManagerConnectionsClient() instead. +type ManagementGroupNetworkManagerConnectionsClient struct { + internal *arm.Client +} + +// NewManagementGroupNetworkManagerConnectionsClient creates a new instance of ManagementGroupNetworkManagerConnectionsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagementGroupNetworkManagerConnectionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementGroupNetworkManagerConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ManagementGroupNetworkManagerConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagementGroupNetworkManagerConnectionsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create a network manager connection on this management group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - networkManagerConnectionName - Name for the network manager connection. +// - parameters - Network manager connection to be created/updated. +// - options - ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the +// ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate method. +func (client *ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, options *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, managementGroupID, networkManagerConnectionName, parameters, options) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, options *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if managementGroupID == "" { + return nil, errors.New("parameter managementGroupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { + result := ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { + return ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete specified pending connection created by this management group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - networkManagerConnectionName - Name for the network manager connection. +// - options - ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete +// method. +func (client *ManagementGroupNetworkManagerConnectionsClient) Delete(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (ManagementGroupNetworkManagerConnectionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, managementGroupID, networkManagerConnectionName, options) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ManagementGroupNetworkManagerConnectionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if managementGroupID == "" { + return nil, errors.New("parameter managementGroupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a specified connection created by this management group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - networkManagerConnectionName - Name for the network manager connection. +// - options - ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get +// method. +func (client *ManagementGroupNetworkManagerConnectionsClient) Get(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientGetOptions) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, managementGroupID, networkManagerConnectionName, options) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if managementGroupID == "" { + return nil, errors.New("parameter managementGroupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagementGroupNetworkManagerConnectionsClient) getHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientGetResponse, error) { + result := ManagementGroupNetworkManagerConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { + return ManagementGroupNetworkManagerConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all network manager connections created by this management group. +// +// Generated from API version 2022-09-01 +// - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. +// - options - ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.NewListPager +// method. +func (client *ManagementGroupNetworkManagerConnectionsClient) NewListPager(managementGroupID string, options *ManagementGroupNetworkManagerConnectionsClientListOptions) *runtime.Pager[ManagementGroupNetworkManagerConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagementGroupNetworkManagerConnectionsClientListResponse]{ + More: func(page ManagementGroupNetworkManagerConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagementGroupNetworkManagerConnectionsClientListResponse) (ManagementGroupNetworkManagerConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, managementGroupID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementGroupNetworkManagerConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest(ctx context.Context, managementGroupID string, options *ManagementGroupNetworkManagerConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections" + if managementGroupID == "" { + return nil, errors.New("parameter managementGroupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managementGroupId}", url.PathEscape(managementGroupID)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagementGroupNetworkManagerConnectionsClient) listHandleResponse(resp *http.Response) (ManagementGroupNetworkManagerConnectionsClientListResponse, error) { + result := ManagementGroupNetworkManagerConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnectionListResult); err != nil { + return ManagementGroupNetworkManagerConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managercommits_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managercommits_client.go new file mode 100644 index 00000000000..42a44f7206f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managercommits_client.go @@ -0,0 +1,114 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ManagerCommitsClient contains the methods for the NetworkManagerCommits group. +// Don't use this type directly, use NewManagerCommitsClient() instead. +type ManagerCommitsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagerCommitsClient creates a new instance of ManagerCommitsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagerCommitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerCommitsClient, error) { + cl, err := arm.NewClient(moduleName+".ManagerCommitsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagerCommitsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginPost - Post a Network Manager Commit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Parameters supplied to specify which Managed Network commit is. +// - options - ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost +// method. +func (client *ManagerCommitsClient) BeginPost(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*runtime.Poller[ManagerCommitsClientPostResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.post(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagerCommitsClientPostResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagerCommitsClientPostResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Post - Post a Network Manager Commit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ManagerCommitsClient) post(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*http.Response, error) { + req, err := client.postCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// postCreateRequest creates the Post request. +func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managerdeploymentstatus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managerdeploymentstatus_client.go new file mode 100644 index 00000000000..9dd15e01af7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managerdeploymentstatus_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ManagerDeploymentStatusClient contains the methods for the NetworkManagerDeploymentStatus group. +// Don't use this type directly, use NewManagerDeploymentStatusClient() instead. +type ManagerDeploymentStatusClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagerDeploymentStatusClient creates a new instance of ManagerDeploymentStatusClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagerDeploymentStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagerDeploymentStatusClient, error) { + cl, err := arm.NewClient(moduleName+".ManagerDeploymentStatusClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagerDeploymentStatusClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Post to List of Network Manager Deployment Status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Parameters supplied to specify which Managed Network deployment status is. +// - options - ManagerDeploymentStatusClientListOptions contains the optional parameters for the ManagerDeploymentStatusClient.List +// method. +func (client *ManagerDeploymentStatusClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerDeploymentStatusParameter, options *ManagerDeploymentStatusClientListOptions) (ManagerDeploymentStatusClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return ManagerDeploymentStatusClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagerDeploymentStatusClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagerDeploymentStatusClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ManagerDeploymentStatusClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerDeploymentStatusParameter, options *ManagerDeploymentStatusClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listHandleResponse handles the List response. +func (client *ManagerDeploymentStatusClient) listHandleResponse(resp *http.Response) (ManagerDeploymentStatusClientListResponse, error) { + result := ManagerDeploymentStatusClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerDeploymentStatusListResult); err != nil { + return ManagerDeploymentStatusClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managers_client.go new file mode 100644 index 00000000000..d2ac751dfac --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/managers_client.go @@ -0,0 +1,425 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ManagersClient contains the methods for the NetworkManagers group. +// Don't use this type directly, use NewManagersClient() instead. +type ManagersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagersClient creates a new instance of ManagersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagersClient, error) { + cl, err := arm.NewClient(moduleName+".ManagersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a Network Manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Parameters supplied to specify which network manager is. +// - options - ManagersClientCreateOrUpdateOptions contains the optional parameters for the ManagersClient.CreateOrUpdate method. +func (client *ManagersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, options *ManagersClientCreateOrUpdateOptions) (ManagersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return ManagersClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, options *ManagersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagersClient) createOrUpdateHandleResponse(resp *http.Response) (ManagersClientCreateOrUpdateResponse, error) { + result := ManagersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { + return ManagersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a network manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. +func (client *ManagersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*runtime.Poller[ManagersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a network manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Network Manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. +func (client *ManagersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (ManagersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, options) + if err != nil { + return ManagersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersClientGetResponse, error) { + result := ManagersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { + return ManagersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List network managers in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. +func (client *ManagersClient) NewListPager(resourceGroupName string, options *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagersClientListResponse]{ + More: func(page ManagersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagersClientListResponse) (ManagersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ManagersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ManagersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers" + 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)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersClientListResponse, error) { + result := ManagersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerListResult); err != nil { + return ManagersClientListResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all network managers in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager +// method. +func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagersClientListBySubscriptionResponse]{ + More: func(page ManagersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagersClientListBySubscriptionResponse) (ManagersClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagersClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagersClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ManagersClient) listBySubscriptionCreateRequest(ctx context.Context, options *ManagersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers" + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ManagersClient) listBySubscriptionHandleResponse(resp *http.Response) (ManagersClientListBySubscriptionResponse, error) { + result := ManagersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerListResult); err != nil { + return ManagersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Patch - Patch NetworkManager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - parameters - Parameters supplied to specify which network manager is. +// - options - ManagersClientPatchOptions contains the optional parameters for the ManagersClient.Patch method. +func (client *ManagersClient) Patch(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, options *ManagersClientPatchOptions) (ManagersClientPatchResponse, error) { + req, err := client.patchCreateRequest(ctx, resourceGroupName, networkManagerName, parameters, options) + if err != nil { + return ManagersClientPatchResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagersClientPatchResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagersClientPatchResponse{}, runtime.NewResponseError(resp) + } + return client.patchHandleResponse(resp) +} + +// patchCreateRequest creates the Patch request. +func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, options *ManagersClientPatchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// patchHandleResponse handles the Patch response. +func (client *ManagersClient) patchHandleResponse(resp *http.Response) (ManagersClientPatchResponse, error) { + result := ManagersClientPatchResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Manager); err != nil { + return ManagersClientPatchResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models.go new file mode 100644 index 00000000000..c1bbfa98ee5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models.go @@ -0,0 +1,17517 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +import "time" + +// AADAuthenticationParameters - AAD Vpn authentication type related parameters. +type AADAuthenticationParameters struct { + // AAD Vpn authentication parameter AAD audience. + AADAudience *string + + // AAD Vpn authentication parameter AAD issuer. + AADIssuer *string + + // AAD Vpn authentication parameter AAD tenant. + AADTenant *string +} + +// Action to be taken on a route matching a RouteMap criterion. +type Action struct { + // List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be dropped.If + // type is add, parameters would have list of ASN numbers to be added + Parameters []*Parameter + + // Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.' + Type *RouteMapActionType +} + +// ActiveBaseSecurityAdminRuleClassification provides polymorphic access to related types. +// Call the interface's GetActiveBaseSecurityAdminRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActiveBaseSecurityAdminRule, *ActiveDefaultSecurityAdminRule, *ActiveSecurityAdminRule +type ActiveBaseSecurityAdminRuleClassification interface { + // GetActiveBaseSecurityAdminRule returns the ActiveBaseSecurityAdminRule content of the underlying type. + GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule +} + +// ActiveBaseSecurityAdminRule - Network base admin rule. +type ActiveBaseSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // Deployment time string. + CommitTime *time.Time + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Deployment region. + Region *string + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveBaseSecurityAdminRule. +func (a *ActiveBaseSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { + return a +} + +// ActiveConfigurationParameter - Effective Virtual Networks Parameter. +type ActiveConfigurationParameter struct { + // List of regions. + Regions []*string + + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string +} + +// ActiveConnectivityConfiguration - Active connectivity configuration. +type ActiveConnectivityConfiguration struct { + // Deployment time string. + CommitTime *time.Time + + // Effective configuration groups. + ConfigurationGroups []*ConfigurationGroup + + // Connectivity configuration ID. + ID *string + + // Properties of a network manager connectivity configuration + Properties *ConnectivityConfigurationProperties + + // Deployment region. + Region *string +} + +// ActiveConnectivityConfigurationsListResult - Result of the request to list active connectivity configurations. It contains +// a list of active connectivity configurations and a skiptoken to get the next set of results. +type ActiveConnectivityConfigurationsListResult struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string + + // Gets a page of active connectivity configurations. + Value []*ActiveConnectivityConfiguration +} + +// ActiveDefaultSecurityAdminRule - Network default admin rule. +type ActiveDefaultSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // Deployment time string. + CommitTime *time.Time + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Indicates the properties of the default security admin rule + Properties *DefaultAdminPropertiesFormat + + // Deployment region. + Region *string + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveDefaultSecurityAdminRule. +func (a *ActiveDefaultSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { + return &ActiveBaseSecurityAdminRule{ + ID: a.ID, + CommitTime: a.CommitTime, + Region: a.Region, + ConfigurationDescription: a.ConfigurationDescription, + RuleCollectionDescription: a.RuleCollectionDescription, + RuleCollectionAppliesToGroups: a.RuleCollectionAppliesToGroups, + RuleGroups: a.RuleGroups, + Kind: a.Kind, + } +} + +// ActiveSecurityAdminRule - Network admin rule. +type ActiveSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // Deployment time string. + CommitTime *time.Time + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Indicates the properties of the security admin rule + Properties *AdminPropertiesFormat + + // Deployment region. + Region *string + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetActiveBaseSecurityAdminRule implements the ActiveBaseSecurityAdminRuleClassification interface for type ActiveSecurityAdminRule. +func (a *ActiveSecurityAdminRule) GetActiveBaseSecurityAdminRule() *ActiveBaseSecurityAdminRule { + return &ActiveBaseSecurityAdminRule{ + ID: a.ID, + CommitTime: a.CommitTime, + Region: a.Region, + ConfigurationDescription: a.ConfigurationDescription, + RuleCollectionDescription: a.RuleCollectionDescription, + RuleCollectionAppliesToGroups: a.RuleCollectionAppliesToGroups, + RuleGroups: a.RuleGroups, + Kind: a.Kind, + } +} + +// ActiveSecurityAdminRulesListResult - Result of the request to list active security admin rules. It contains a list of active +// security admin rules and a skiptoken to get the next set of results. +type ActiveSecurityAdminRulesListResult struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string + + // Gets a page of active security admin rules. + Value []ActiveBaseSecurityAdminRuleClassification +} + +// AddressPrefixItem - Address prefix item. +type AddressPrefixItem struct { + // Address prefix. + AddressPrefix *string + + // Address prefix type. + AddressPrefixType *AddressPrefixType +} + +// AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. +type AddressSpace struct { + // A list of address blocks reserved for this virtual network in CIDR notation. + AddressPrefixes []*string +} + +// AdminPropertiesFormat - Security admin rule resource. +type AdminPropertiesFormat struct { + // REQUIRED; Indicates the access allowed for this particular rule + Access *SecurityConfigurationRuleAccess + + // REQUIRED; Indicates if the traffic matched against the rule in inbound or outbound. + Direction *SecurityConfigurationRuleDirection + + // REQUIRED; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule + // in the collection. The lower the priority number, the higher the priority of the rule. + Priority *int32 + + // REQUIRED; Network protocol this rule applies to. + Protocol *SecurityConfigurationRuleProtocol + + // A description for this rule. Restricted to 140 chars. + Description *string + + // The destination port ranges. + DestinationPortRanges []*string + + // The destination address prefixes. CIDR or destination IP ranges. + Destinations []*AddressPrefixItem + + // The source port ranges. + SourcePortRanges []*string + + // The CIDR or source IP ranges. + Sources []*AddressPrefixItem + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// AdminRule - Network admin rule. +type AdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *AdminRuleKind + + // Indicates the properties of the security admin rule + Properties *AdminPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type AdminRule. +func (a *AdminRule) GetBaseAdminRule() *BaseAdminRule { + return &BaseAdminRule{ + Kind: a.Kind, + SystemData: a.SystemData, + ID: a.ID, + Name: a.Name, + Type: a.Type, + Etag: a.Etag, + } +} + +// AdminRuleCollection - Defines the admin rule collection. +type AdminRuleCollection struct { + // Indicates the properties for the network manager admin rule collection. + Properties *AdminRuleCollectionPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// AdminRuleCollectionListResult - Security admin configuration rule collection list result. +type AdminRuleCollectionListResult struct { + // Gets the URL to get the next set of results. + NextLink *string + + // A list of network manager security admin configuration rule collections + Value []*AdminRuleCollection +} + +// AdminRuleCollectionPropertiesFormat - Defines the admin rule collection properties. +type AdminRuleCollectionPropertiesFormat struct { + // REQUIRED; Groups for configuration + AppliesToGroups []*ManagerSecurityGroupItem + + // A description of the admin rule collection. + Description *string + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// AdminRuleCollectionsClientBeginDeleteOptions contains the optional parameters for the AdminRuleCollectionsClient.BeginDelete +// method. +type AdminRuleCollectionsClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AdminRuleCollectionsClientCreateOrUpdateOptions contains the optional parameters for the AdminRuleCollectionsClient.CreateOrUpdate +// method. +type AdminRuleCollectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AdminRuleCollectionsClientGetOptions contains the optional parameters for the AdminRuleCollectionsClient.Get method. +type AdminRuleCollectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AdminRuleCollectionsClientListOptions contains the optional parameters for the AdminRuleCollectionsClient.NewListPager +// method. +type AdminRuleCollectionsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// AdminRuleListResult - security configuration admin rule list result. +type AdminRuleListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of admin rules + Value []BaseAdminRuleClassification +} + +// AdminRulesClientBeginDeleteOptions contains the optional parameters for the AdminRulesClient.BeginDelete method. +type AdminRulesClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AdminRulesClientCreateOrUpdateOptions contains the optional parameters for the AdminRulesClient.CreateOrUpdate method. +type AdminRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AdminRulesClientGetOptions contains the optional parameters for the AdminRulesClient.Get method. +type AdminRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// AdminRulesClientListOptions contains the optional parameters for the AdminRulesClient.NewListPager method. +type AdminRulesClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ApplicationGateway - Application gateway resource. +type ApplicationGateway struct { + // Resource ID. + ID *string + + // The identity of the application gateway, if configured. + Identity *ManagedServiceIdentity + + // Resource location. + Location *string + + // Properties of the application gateway. + Properties *ApplicationGatewayPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting where the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ApplicationGatewayAuthenticationCertificate - Authentication certificates of an application gateway. +type ApplicationGatewayAuthenticationCertificate struct { + // Resource ID. + ID *string + + // Name of the authentication certificate that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway authentication certificate. + Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayAuthenticationCertificatePropertiesFormat - Authentication certificates properties of an application +// gateway. +type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { + // Certificate public data. + Data *string + + // READ-ONLY; The provisioning state of the authentication certificate resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayAutoscaleConfiguration - Application Gateway autoscale configuration. +type ApplicationGatewayAutoscaleConfiguration struct { + // REQUIRED; Lower bound on number of Application Gateway capacity. + MinCapacity *int32 + + // Upper bound on number of Application Gateway capacity. + MaxCapacity *int32 +} + +// ApplicationGatewayAvailableSSLOptions - Response for ApplicationGatewayAvailableSslOptions API service call. +type ApplicationGatewayAvailableSSLOptions struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the application gateway available SSL options. + Properties *ApplicationGatewayAvailableSSLOptionsPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ApplicationGatewayAvailableSSLOptionsPropertiesFormat - Properties of ApplicationGatewayAvailableSslOptions. +type ApplicationGatewayAvailableSSLOptionsPropertiesFormat struct { + // List of available Ssl cipher suites. + AvailableCipherSuites []*ApplicationGatewaySSLCipherSuite + + // List of available Ssl protocols. + AvailableProtocols []*ApplicationGatewaySSLProtocol + + // Name of the Ssl predefined policy applied by default to application gateway. + DefaultPolicy *ApplicationGatewaySSLPolicyName + + // List of available Ssl predefined policy. + PredefinedPolicies []*SubResource +} + +// ApplicationGatewayAvailableSSLPredefinedPolicies - Response for ApplicationGatewayAvailableSslOptions API service call. +type ApplicationGatewayAvailableSSLPredefinedPolicies struct { + // URL to get the next set of results. + NextLink *string + + // List of available Ssl predefined policy. + Value []*ApplicationGatewaySSLPredefinedPolicy +} + +// ApplicationGatewayAvailableWafRuleSetsResult - Response for ApplicationGatewayAvailableWafRuleSets API service call. +type ApplicationGatewayAvailableWafRuleSetsResult struct { + // The list of application gateway rule sets. + Value []*ApplicationGatewayFirewallRuleSet +} + +// ApplicationGatewayBackendAddress - Backend address of an application gateway. +type ApplicationGatewayBackendAddress struct { + // Fully qualified domain name (FQDN). + Fqdn *string + + // IP address. + IPAddress *string +} + +// ApplicationGatewayBackendAddressPool - Backend Address Pool of an application gateway. +type ApplicationGatewayBackendAddressPool struct { + // Resource ID. + ID *string + + // Name of the backend address pool that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway backend address pool. + Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of Backend Address Pool of an application gateway. +type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { + // Backend addresses. + BackendAddresses []*ApplicationGatewayBackendAddress + + // READ-ONLY; Collection of references to IPs defined in network interfaces. + BackendIPConfigurations []*InterfaceIPConfiguration + + // READ-ONLY; The provisioning state of the backend address pool resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayBackendHTTPSettings - Backend address pool settings of an application gateway. +type ApplicationGatewayBackendHTTPSettings struct { + // Resource ID. + ID *string + + // Name of the backend http settings that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway backend HTTP settings. + Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of Backend address pool settings of an application gateway. +type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { + // Cookie name to use for the affinity cookie. + AffinityCookieName *string + + // Array of references to application gateway authentication certificates. + AuthenticationCertificates []*SubResource + + // Connection draining of the backend http settings resource. + ConnectionDraining *ApplicationGatewayConnectionDraining + + // Cookie based affinity. + CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity + + // Host header to be sent to the backend servers. + HostName *string + + // Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + Path *string + + // Whether to pick host header should be picked from the host name of the backend server. Default value is false. + PickHostNameFromBackendAddress *bool + + // The destination port on the backend. + Port *int32 + + // Probe resource of an application gateway. + Probe *SubResource + + // Whether the probe is enabled. Default value is false. + ProbeEnabled *bool + + // The protocol used to communicate with the backend. + Protocol *ApplicationGatewayProtocol + + // Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. + // Acceptable values are from 1 second to 86400 seconds. + RequestTimeout *int32 + + // Array of references to application gateway trusted root certificates. + TrustedRootCertificates []*SubResource + + // READ-ONLY; The provisioning state of the backend HTTP settings resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayBackendHealth - Response for ApplicationGatewayBackendHealth API service call. +type ApplicationGatewayBackendHealth struct { + // A list of ApplicationGatewayBackendHealthPool resources. + BackendAddressPools []*ApplicationGatewayBackendHealthPool +} + +// ApplicationGatewayBackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. +type ApplicationGatewayBackendHealthHTTPSettings struct { + // Reference to an ApplicationGatewayBackendHttpSettings resource. + BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings + + // List of ApplicationGatewayBackendHealthServer resources. + Servers []*ApplicationGatewayBackendHealthServer +} + +// ApplicationGatewayBackendHealthOnDemand - Result of on demand test probe. +type ApplicationGatewayBackendHealthOnDemand struct { + // Reference to an ApplicationGatewayBackendAddressPool resource. + BackendAddressPool *ApplicationGatewayBackendAddressPool + + // Application gateway BackendHealthHttp settings. + BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings +} + +// ApplicationGatewayBackendHealthPool - Application gateway BackendHealth pool. +type ApplicationGatewayBackendHealthPool struct { + // Reference to an ApplicationGatewayBackendAddressPool resource. + BackendAddressPool *ApplicationGatewayBackendAddressPool + + // List of ApplicationGatewayBackendHealthHttpSettings resources. + BackendHTTPSettingsCollection []*ApplicationGatewayBackendHealthHTTPSettings +} + +// ApplicationGatewayBackendHealthServer - Application gateway backendhealth http settings. +type ApplicationGatewayBackendHealthServer struct { + // IP address or FQDN of backend server. + Address *string + + // Health of backend server. + Health *ApplicationGatewayBackendHealthServerHealth + + // Health Probe Log. + HealthProbeLog *string + + // Reference to IP configuration of backend server. + IPConfiguration *InterfaceIPConfiguration +} + +// ApplicationGatewayBackendSettings - Backend address pool settings of an application gateway. +type ApplicationGatewayBackendSettings struct { + // Resource ID. + ID *string + + // Name of the backend settings that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway backend settings. + Properties *ApplicationGatewayBackendSettingsPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayBackendSettingsPropertiesFormat - Properties of Backend address pool settings of an application gateway. +type ApplicationGatewayBackendSettingsPropertiesFormat struct { + // Server name indication to be sent to the backend servers for Tls protocol. + HostName *string + + // Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. + PickHostNameFromBackendAddress *bool + + // The destination port on the backend. + Port *int32 + + // Probe resource of an application gateway. + Probe *SubResource + + // The protocol used to communicate with the backend. + Protocol *ApplicationGatewayProtocol + + // Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. + // Acceptable values are from 1 second to 86400 seconds. + Timeout *int32 + + // Array of references to application gateway trusted root certificates. + TrustedRootCertificates []*SubResource + + // READ-ONLY; The provisioning state of the backend HTTP settings resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayClientAuthConfiguration - Application gateway client authentication configuration. +type ApplicationGatewayClientAuthConfiguration struct { + // Verify client certificate issuer name on the application gateway. + VerifyClientCertIssuerDN *bool + + // Verify client certificate revocation status. + VerifyClientRevocation *ApplicationGatewayClientRevocationOptions +} + +// ApplicationGatewayConnectionDraining - Connection draining allows open connections to a backend server to be active for +// a specified time after the backend server got removed from the configuration. +type ApplicationGatewayConnectionDraining struct { + // REQUIRED; The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + DrainTimeoutInSec *int32 + + // REQUIRED; Whether connection draining is enabled or not. + Enabled *bool +} + +// ApplicationGatewayCustomError - Custom error of an application gateway. +type ApplicationGatewayCustomError struct { + // Error page URL of the application gateway custom error. + CustomErrorPageURL *string + + // Status code of the application gateway custom error. + StatusCode *ApplicationGatewayCustomErrorStatusCode +} + +// ApplicationGatewayFirewallDisabledRuleGroup - Allows to disable rules within a rule group or an entire rule group. +type ApplicationGatewayFirewallDisabledRuleGroup struct { + // REQUIRED; The name of the rule group that will be disabled. + RuleGroupName *string + + // The list of rules that will be disabled. If null, all rules of the rule group will be disabled. + Rules []*int32 +} + +// ApplicationGatewayFirewallExclusion - Allow to exclude some variable satisfy the condition for the WAF check. +type ApplicationGatewayFirewallExclusion struct { + // REQUIRED; The variable to be excluded. + MatchVariable *string + + // REQUIRED; When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + // applies to. + Selector *string + + // REQUIRED; When matchVariable is a collection, operate on the selector to specify which elements in the collection this + // exclusion applies to. + SelectorMatchOperator *string +} + +// ApplicationGatewayFirewallManifestRuleSet - Properties of the web application firewall rule set. +type ApplicationGatewayFirewallManifestRuleSet struct { + // REQUIRED; The rule groups of the web application firewall rule set. + RuleGroups []*ApplicationGatewayFirewallRuleGroup + + // REQUIRED; The type of the web application firewall rule set. + RuleSetType *string + + // REQUIRED; The version of the web application firewall rule set type. + RuleSetVersion *string + + // The rule set status + Status *ApplicationGatewayRuleSetStatusOptions + + // Tier of an application gateway that support the rule set. + Tiers []*ApplicationGatewayTierTypes +} + +// ApplicationGatewayFirewallRule - A web application firewall rule. +type ApplicationGatewayFirewallRule struct { + // REQUIRED; The identifier of the web application firewall rule. + RuleID *int32 + + // The string representation of the web application firewall rule action. + Action *ApplicationGatewayWafRuleActionTypes + + // The description of the web application firewall rule. + Description *string + + // The string representation of the web application firewall rule identifier. + RuleIDString *string + + // The string representation of the web application firewall rule state. + State *ApplicationGatewayWafRuleStateTypes +} + +// ApplicationGatewayFirewallRuleGroup - A web application firewall rule group. +type ApplicationGatewayFirewallRuleGroup struct { + // REQUIRED; The name of the web application firewall rule group. + RuleGroupName *string + + // REQUIRED; The rules of the web application firewall rule group. + Rules []*ApplicationGatewayFirewallRule + + // The description of the web application firewall rule group. + Description *string +} + +// ApplicationGatewayFirewallRuleSet - A web application firewall rule set. +type ApplicationGatewayFirewallRuleSet struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the application gateway firewall rule set. + Properties *ApplicationGatewayFirewallRuleSetPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the web application firewall rule set. +type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { + // REQUIRED; The rule groups of the web application firewall rule set. + RuleGroups []*ApplicationGatewayFirewallRuleGroup + + // REQUIRED; The type of the web application firewall rule set. + RuleSetType *string + + // REQUIRED; The version of the web application firewall rule set type. + RuleSetVersion *string + + // Tier of an application gateway that support the rule set. + Tiers []*ApplicationGatewayTierTypes + + // READ-ONLY; The provisioning state of the web application firewall rule set. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayFrontendIPConfiguration - Frontend IP configuration of an application gateway. +type ApplicationGatewayFrontendIPConfiguration struct { + // Resource ID. + ID *string + + // Name of the frontend IP configuration that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway frontend IP configuration. + Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of Frontend IP configuration of an application gateway. +type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { + // PrivateIPAddress of the network interface IP Configuration. + PrivateIPAddress *string + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // Reference to the application gateway private link configuration. + PrivateLinkConfiguration *SubResource + + // Reference to the PublicIP resource. + PublicIPAddress *SubResource + + // Reference to the subnet resource. + Subnet *SubResource + + // READ-ONLY; The provisioning state of the frontend IP configuration resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayFrontendPort - Frontend port of an application gateway. +type ApplicationGatewayFrontendPort struct { + // Resource ID. + ID *string + + // Name of the frontend port that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway frontend port. + Properties *ApplicationGatewayFrontendPortPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayFrontendPortPropertiesFormat - Properties of Frontend port of an application gateway. +type ApplicationGatewayFrontendPortPropertiesFormat struct { + // Frontend port. + Port *int32 + + // READ-ONLY; The provisioning state of the frontend port resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayGlobalConfiguration - Application Gateway global configuration. +type ApplicationGatewayGlobalConfiguration struct { + // Enable request buffering. + EnableRequestBuffering *bool + + // Enable response buffering. + EnableResponseBuffering *bool +} + +// ApplicationGatewayHTTPListener - Http listener of an application gateway. +type ApplicationGatewayHTTPListener struct { + // Resource ID. + ID *string + + // Name of the HTTP listener that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway HTTP listener. + Properties *ApplicationGatewayHTTPListenerPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayHTTPListenerPropertiesFormat - Properties of HTTP listener of an application gateway. +type ApplicationGatewayHTTPListenerPropertiesFormat struct { + // Custom error configurations of the HTTP listener. + CustomErrorConfigurations []*ApplicationGatewayCustomError + + // Reference to the FirewallPolicy resource. + FirewallPolicy *SubResource + + // Frontend IP configuration resource of an application gateway. + FrontendIPConfiguration *SubResource + + // Frontend port resource of an application gateway. + FrontendPort *SubResource + + // Host name of HTTP listener. + HostName *string + + // List of Host names for HTTP Listener that allows special wildcard characters as well. + HostNames []*string + + // Protocol of the HTTP listener. + Protocol *ApplicationGatewayProtocol + + // Applicable only if protocol is https. Enables SNI for multi-hosting. + RequireServerNameIndication *bool + + // SSL certificate resource of an application gateway. + SSLCertificate *SubResource + + // SSL profile resource of the application gateway. + SSLProfile *SubResource + + // READ-ONLY; The provisioning state of the HTTP listener resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayHeaderConfiguration - Header configuration of the Actions set in Application Gateway. +type ApplicationGatewayHeaderConfiguration struct { + // Header name of the header configuration. + HeaderName *string + + // Header value of the header configuration. + HeaderValue *string +} + +// ApplicationGatewayIPConfiguration - IP configuration of an application gateway. Currently 1 public and 1 private IP configuration +// is allowed. +type ApplicationGatewayIPConfiguration struct { + // Resource ID. + ID *string + + // Name of the IP configuration that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway IP configuration. + Properties *ApplicationGatewayIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayIPConfigurationPropertiesFormat - Properties of IP configuration of an application gateway. +type ApplicationGatewayIPConfigurationPropertiesFormat struct { + // Reference to the subnet resource. A subnet from where application gateway gets its private address. + Subnet *SubResource + + // READ-ONLY; The provisioning state of the application gateway IP configuration resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayListResult - Response for ListApplicationGateways API service call. +type ApplicationGatewayListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of an application gateways in a resource group. + Value []*ApplicationGateway +} + +// ApplicationGatewayListener - Listener of an application gateway. +type ApplicationGatewayListener struct { + // Resource ID. + ID *string + + // Name of the listener that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway listener. + Properties *ApplicationGatewayListenerPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayListenerPropertiesFormat - Properties of listener of an application gateway. +type ApplicationGatewayListenerPropertiesFormat struct { + // Frontend IP configuration resource of an application gateway. + FrontendIPConfiguration *SubResource + + // Frontend port resource of an application gateway. + FrontendPort *SubResource + + // Protocol of the listener. + Protocol *ApplicationGatewayProtocol + + // SSL certificate resource of an application gateway. + SSLCertificate *SubResource + + // SSL profile resource of the application gateway. + SSLProfile *SubResource + + // READ-ONLY; The provisioning state of the listener resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayLoadDistributionPolicy - Load Distribution Policy of an application gateway. +type ApplicationGatewayLoadDistributionPolicy struct { + // Resource ID. + ID *string + + // Name of the load distribution policy that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway load distribution policy. + Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayLoadDistributionPolicyPropertiesFormat - Properties of Load Distribution Policy of an application gateway. +type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { + // Load Distribution Targets resource of an application gateway. + LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm + + // Load Distribution Targets resource of an application gateway. + LoadDistributionTargets []*ApplicationGatewayLoadDistributionTarget + + // READ-ONLY; The provisioning state of the Load Distribution Policy resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayLoadDistributionTarget - Load Distribution Target of an application gateway. +type ApplicationGatewayLoadDistributionTarget struct { + // Resource ID. + ID *string + + // Name of the load distribution policy that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway load distribution target. + Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { + // Backend address pool resource of the application gateway. + BackendAddressPool *SubResource + + // Weight per server. Range between 1 and 100. + WeightPerServer *int32 +} + +// ApplicationGatewayOnDemandProbe - Details of on demand test probe request. +type ApplicationGatewayOnDemandProbe struct { + // Reference to backend pool of application gateway to which probe request will be sent. + BackendAddressPool *SubResource + + // Reference to backend http setting of application gateway to be used for test probe. + BackendHTTPSettings *SubResource + + // Host name to send the probe to. + Host *string + + // Criterion for classifying a healthy probe response. + Match *ApplicationGatewayProbeHealthResponseMatch + + // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + Path *string + + // Whether the host header should be picked from the backend http settings. Default value is false. + PickHostNameFromBackendHTTPSettings *bool + + // The protocol used for the probe. + Protocol *ApplicationGatewayProtocol + + // The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable + // values are from 1 second to 86400 seconds. + Timeout *int32 +} + +// ApplicationGatewayPathRule - Path rule of URL path map of an application gateway. +type ApplicationGatewayPathRule struct { + // Resource ID. + ID *string + + // Name of the path rule that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway path rule. + Properties *ApplicationGatewayPathRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayPathRulePropertiesFormat - Properties of path rule of an application gateway. +type ApplicationGatewayPathRulePropertiesFormat struct { + // Backend address pool resource of URL path map path rule. + BackendAddressPool *SubResource + + // Backend http settings resource of URL path map path rule. + BackendHTTPSettings *SubResource + + // Reference to the FirewallPolicy resource. + FirewallPolicy *SubResource + + // Load Distribution Policy resource of URL path map path rule. + LoadDistributionPolicy *SubResource + + // Path rules of URL path map. + Paths []*string + + // Redirect configuration resource of URL path map path rule. + RedirectConfiguration *SubResource + + // Rewrite rule set resource of URL path map path rule. + RewriteRuleSet *SubResource + + // READ-ONLY; The provisioning state of the path rule resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayPrivateEndpointConnection - Private Endpoint connection on an application gateway. +type ApplicationGatewayPrivateEndpointConnection struct { + // Resource ID. + ID *string + + // Name of the private endpoint connection on an application gateway. + Name *string + + // Properties of the application gateway private endpoint connection. + Properties *ApplicationGatewayPrivateEndpointConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayPrivateEndpointConnectionListResult - Response for ListApplicationGatewayPrivateEndpointConnection API +// service call. Gets all private endpoint connections for an application gateway. +type ApplicationGatewayPrivateEndpointConnectionListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of private endpoint connections on an application gateway. + Value []*ApplicationGatewayPrivateEndpointConnection +} + +// ApplicationGatewayPrivateEndpointConnectionProperties - Properties of Private Link Resource of an application gateway. +type ApplicationGatewayPrivateEndpointConnectionProperties struct { + // A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + + // READ-ONLY; The consumer link id. + LinkIdentifier *string + + // READ-ONLY; The resource of private end point. + PrivateEndpoint *PrivateEndpoint + + // READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete +// method. +type ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate +// method. +type ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewayPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.Get +// method. +type ApplicationGatewayPrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager +// method. +type ApplicationGatewayPrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewayPrivateLinkConfiguration - Private Link Configuration on an application gateway. +type ApplicationGatewayPrivateLinkConfiguration struct { + // Resource ID. + ID *string + + // Name of the private link configuration that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway private link configuration. + Properties *ApplicationGatewayPrivateLinkConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayPrivateLinkConfigurationProperties - Properties of private link configuration on an application gateway. +type ApplicationGatewayPrivateLinkConfigurationProperties struct { + // An array of application gateway private link ip configurations. + IPConfigurations []*ApplicationGatewayPrivateLinkIPConfiguration + + // READ-ONLY; The provisioning state of the application gateway private link configuration. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayPrivateLinkIPConfiguration - The application gateway private link ip configuration. +type ApplicationGatewayPrivateLinkIPConfiguration struct { + // Resource ID. + ID *string + + // The name of application gateway private link ip configuration. + Name *string + + // Properties of an application gateway private link ip configuration. + Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The resource type. + Type *string +} + +// ApplicationGatewayPrivateLinkIPConfigurationProperties - Properties of an application gateway private link IP configuration. +type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { + // Whether the ip configuration is primary or not. + Primary *bool + + // The private IP address of the IP configuration. + PrivateIPAddress *string + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // Reference to the subnet resource. + Subnet *SubResource + + // READ-ONLY; The provisioning state of the application gateway private link IP configuration. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayPrivateLinkResource - PrivateLink Resource of an application gateway. +type ApplicationGatewayPrivateLinkResource struct { + // Resource ID. + ID *string + + // Name of the private link resource that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway private link resource. + Properties *ApplicationGatewayPrivateLinkResourceProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayPrivateLinkResourceListResult - Response for ListApplicationGatewayPrivateLinkResources API service call. +// Gets all private link resources for an application gateway. +type ApplicationGatewayPrivateLinkResourceListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of private link resources of an application gateway. + Value []*ApplicationGatewayPrivateLinkResource +} + +// ApplicationGatewayPrivateLinkResourceProperties - Properties of a private link resource. +type ApplicationGatewayPrivateLinkResourceProperties struct { + // Required DNS zone names of the the private link resource. + RequiredZoneNames []*string + + // READ-ONLY; Group identifier of private link resource. + GroupID *string + + // READ-ONLY; Required member names of private link resource. + RequiredMembers []*string +} + +// ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.NewListPager +// method. +type ApplicationGatewayPrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewayProbe - Probe of the application gateway. +type ApplicationGatewayProbe struct { + // Resource ID. + ID *string + + // Name of the probe that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway probe. + Properties *ApplicationGatewayProbePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayProbeHealthResponseMatch - Application gateway probe health response match. +type ApplicationGatewayProbeHealthResponseMatch struct { + // Body that must be contained in the health response. Default value is empty. + Body *string + + // Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + StatusCodes []*string +} + +// ApplicationGatewayProbePropertiesFormat - Properties of probe of an application gateway. +type ApplicationGatewayProbePropertiesFormat struct { + // Host name to send the probe to. + Host *string + + // The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 + // second to 86400 seconds. + Interval *int32 + + // Criterion for classifying a healthy probe response. + Match *ApplicationGatewayProbeHealthResponseMatch + + // Minimum number of servers that are always marked healthy. Default value is 0. + MinServers *int32 + + // Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + Path *string + + // Whether the host header should be picked from the backend http settings. Default value is false. + PickHostNameFromBackendHTTPSettings *bool + + // Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is false. + PickHostNameFromBackendSettings *bool + + // Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, + // port from http settings will be used. This property is valid for Standardv2 and + // WAFv2 only. + Port *int32 + + // The protocol used for the probe. + Protocol *ApplicationGatewayProtocol + + // The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable + // values are from 1 second to 86400 seconds. + Timeout *int32 + + // The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. + // Acceptable values are from 1 second to 20. + UnhealthyThreshold *int32 + + // READ-ONLY; The provisioning state of the probe resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayPropertiesFormat - Properties of the application gateway. +type ApplicationGatewayPropertiesFormat struct { + // Authentication certificates of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + AuthenticationCertificates []*ApplicationGatewayAuthenticationCertificate + + // Autoscale Configuration. + AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration + + // Backend address pool of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + BackendAddressPools []*ApplicationGatewayBackendAddressPool + + // Backend http settings of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + BackendHTTPSettingsCollection []*ApplicationGatewayBackendHTTPSettings + + // Backend settings of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] + // . + BackendSettingsCollection []*ApplicationGatewayBackendSettings + + // Custom error configurations of the application gateway resource. + CustomErrorConfigurations []*ApplicationGatewayCustomError + + // Whether FIPS is enabled on the application gateway resource. + EnableFips *bool + + // Whether HTTP2 is enabled on the application gateway resource. + EnableHTTP2 *bool + + // Reference to the FirewallPolicy resource. + FirewallPolicy *SubResource + + // If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. + ForceFirewallPolicyAssociation *bool + + // Frontend IP addresses of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + FrontendIPConfigurations []*ApplicationGatewayFrontendIPConfiguration + + // Frontend ports of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + FrontendPorts []*ApplicationGatewayFrontendPort + + // Subnets of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + GatewayIPConfigurations []*ApplicationGatewayIPConfiguration + + // Global Configuration. + GlobalConfiguration *ApplicationGatewayGlobalConfiguration + + // Http listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + HTTPListeners []*ApplicationGatewayHTTPListener + + // Listeners of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + Listeners []*ApplicationGatewayListener + + // Load distribution policies of the application gateway resource. + LoadDistributionPolicies []*ApplicationGatewayLoadDistributionPolicy + + // PrivateLink configurations on application gateway. + PrivateLinkConfigurations []*ApplicationGatewayPrivateLinkConfiguration + + // Probes of the application gateway resource. + Probes []*ApplicationGatewayProbe + + // Redirect configurations of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + RedirectConfigurations []*ApplicationGatewayRedirectConfiguration + + // Request routing rules of the application gateway resource. + RequestRoutingRules []*ApplicationGatewayRequestRoutingRule + + // Rewrite rules for the application gateway resource. + RewriteRuleSets []*ApplicationGatewayRewriteRuleSet + + // Routing rules of the application gateway resource. + RoutingRules []*ApplicationGatewayRoutingRule + + // SKU of the application gateway resource. + SKU *ApplicationGatewaySKU + + // SSL certificates of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits] + // . + SSLCertificates []*ApplicationGatewaySSLCertificate + + // SSL policy of the application gateway resource. + SSLPolicy *ApplicationGatewaySSLPolicy + + // SSL profiles of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + SSLProfiles []*ApplicationGatewaySSLProfile + + // Trusted client certificates of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + TrustedClientCertificates []*ApplicationGatewayTrustedClientCertificate + + // Trusted Root certificates of the application gateway resource. For default limits, see Application Gateway limits + // [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + TrustedRootCertificates []*ApplicationGatewayTrustedRootCertificate + + // URL path map of the application gateway resource. For default limits, see Application Gateway limits [https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits]. + URLPathMaps []*ApplicationGatewayURLPathMap + + // Web application firewall configuration. + WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration + + // READ-ONLY; Operational state of the application gateway resource. + OperationalState *ApplicationGatewayOperationalState + + // READ-ONLY; Private Endpoint connections on application gateway. + PrivateEndpointConnections []*ApplicationGatewayPrivateEndpointConnection + + // READ-ONLY; The provisioning state of the application gateway resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the application gateway resource. + ResourceGUID *string +} + +// ApplicationGatewayRedirectConfiguration - Redirect configuration of an application gateway. +type ApplicationGatewayRedirectConfiguration struct { + // Resource ID. + ID *string + + // Name of the redirect configuration that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway redirect configuration. + Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayRedirectConfigurationPropertiesFormat - Properties of redirect configuration of the application gateway. +type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { + // Include path in the redirected url. + IncludePath *bool + + // Include query string in the redirected url. + IncludeQueryString *bool + + // Path rules specifying redirect configuration. + PathRules []*SubResource + + // HTTP redirection type. + RedirectType *ApplicationGatewayRedirectType + + // Request routing specifying redirect configuration. + RequestRoutingRules []*SubResource + + // Reference to a listener to redirect the request to. + TargetListener *SubResource + + // Url to redirect the request to. + TargetURL *string + + // Url path maps specifying default redirect configuration. + URLPathMaps []*SubResource +} + +// ApplicationGatewayRequestRoutingRule - Request routing rule of an application gateway. +type ApplicationGatewayRequestRoutingRule struct { + // Resource ID. + ID *string + + // Name of the request routing rule that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway request routing rule. + Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayRequestRoutingRulePropertiesFormat - Properties of request routing rule of the application gateway. +type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { + // Backend address pool resource of the application gateway. + BackendAddressPool *SubResource + + // Backend http settings resource of the application gateway. + BackendHTTPSettings *SubResource + + // Http listener resource of the application gateway. + HTTPListener *SubResource + + // Load Distribution Policy resource of the application gateway. + LoadDistributionPolicy *SubResource + + // Priority of the request routing rule. + Priority *int32 + + // Redirect configuration resource of the application gateway. + RedirectConfiguration *SubResource + + // Rewrite Rule Set resource in Basic rule of the application gateway. + RewriteRuleSet *SubResource + + // Rule type. + RuleType *ApplicationGatewayRequestRoutingRuleType + + // URL path map resource of the application gateway. + URLPathMap *SubResource + + // READ-ONLY; The provisioning state of the request routing rule resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayRewriteRule - Rewrite rule of an application gateway. +type ApplicationGatewayRewriteRule struct { + // Set of actions to be done as part of the rewrite Rule. + ActionSet *ApplicationGatewayRewriteRuleActionSet + + // Conditions based on which the action set execution will be evaluated. + Conditions []*ApplicationGatewayRewriteRuleCondition + + // Name of the rewrite rule that is unique within an Application Gateway. + Name *string + + // Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a RewriteRuleSet. + RuleSequence *int32 +} + +// ApplicationGatewayRewriteRuleActionSet - Set of actions in the Rewrite Rule in Application Gateway. +type ApplicationGatewayRewriteRuleActionSet struct { + // Request Header Actions in the Action Set. + RequestHeaderConfigurations []*ApplicationGatewayHeaderConfiguration + + // Response Header Actions in the Action Set. + ResponseHeaderConfigurations []*ApplicationGatewayHeaderConfiguration + + // Url Configuration Action in the Action Set. + URLConfiguration *ApplicationGatewayURLConfiguration +} + +// ApplicationGatewayRewriteRuleCondition - Set of conditions in the Rewrite Rule in Application Gateway. +type ApplicationGatewayRewriteRuleCondition struct { + // Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. + IgnoreCase *bool + + // Setting this value as truth will force to check the negation of the condition given by the user. + Negate *bool + + // The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. + Pattern *string + + // The condition parameter of the RewriteRuleCondition. + Variable *string +} + +// ApplicationGatewayRewriteRuleSet - Rewrite rule set of an application gateway. +type ApplicationGatewayRewriteRuleSet struct { + // Resource ID. + ID *string + + // Name of the rewrite rule set that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway rewrite rule set. + Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// ApplicationGatewayRewriteRuleSetPropertiesFormat - Properties of rewrite rule set of the application gateway. +type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { + // Rewrite rules in the rewrite rule set. + RewriteRules []*ApplicationGatewayRewriteRule + + // READ-ONLY; The provisioning state of the rewrite rule set resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayRoutingRule - Routing rule of an application gateway. +type ApplicationGatewayRoutingRule struct { + // Resource ID. + ID *string + + // Name of the routing rule that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway routing rule. + Properties *ApplicationGatewayRoutingRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayRoutingRulePropertiesFormat - Properties of routing rule of the application gateway. +type ApplicationGatewayRoutingRulePropertiesFormat struct { + // REQUIRED; Priority of the routing rule. + Priority *int32 + + // Backend address pool resource of the application gateway. + BackendAddressPool *SubResource + + // Backend settings resource of the application gateway. + BackendSettings *SubResource + + // Listener resource of the application gateway. + Listener *SubResource + + // Rule type. + RuleType *ApplicationGatewayRequestRoutingRuleType + + // READ-ONLY; The provisioning state of the request routing rule resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewaySKU - SKU of an application gateway. +type ApplicationGatewaySKU struct { + // Capacity (instance count) of an application gateway. + Capacity *int32 + + // Name of an application gateway SKU. + Name *ApplicationGatewaySKUName + + // Tier of an application gateway. + Tier *ApplicationGatewayTier +} + +// ApplicationGatewaySSLCertificate - SSL certificates of an application gateway. +type ApplicationGatewaySSLCertificate struct { + // Resource ID. + ID *string + + // Name of the SSL certificate that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway SSL certificate. + Properties *ApplicationGatewaySSLCertificatePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewaySSLCertificatePropertiesFormat - Properties of SSL certificates of an application gateway. +type ApplicationGatewaySSLCertificatePropertiesFormat struct { + // Base-64 encoded pfx certificate. Only applicable in PUT Request. + Data *string + + // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + KeyVaultSecretID *string + + // Password for the pfx file specified in data. Only applicable in PUT request. + Password *string + + // READ-ONLY; The provisioning state of the SSL certificate resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + PublicCertData *string +} + +// ApplicationGatewaySSLPolicy - Application Gateway Ssl policy. +type ApplicationGatewaySSLPolicy struct { + // Ssl cipher suites to be enabled in the specified order to application gateway. + CipherSuites []*ApplicationGatewaySSLCipherSuite + + // Ssl protocols to be disabled on application gateway. + DisabledSSLProtocols []*ApplicationGatewaySSLProtocol + + // Minimum version of Ssl protocol to be supported on application gateway. + MinProtocolVersion *ApplicationGatewaySSLProtocol + + // Name of Ssl predefined policy. + PolicyName *ApplicationGatewaySSLPolicyName + + // Type of Ssl Policy. + PolicyType *ApplicationGatewaySSLPolicyType +} + +// ApplicationGatewaySSLPredefinedPolicy - An Ssl predefined policy. +type ApplicationGatewaySSLPredefinedPolicy struct { + // Resource ID. + ID *string + + // Name of the Ssl predefined policy. + Name *string + + // Properties of the application gateway SSL predefined policy. + Properties *ApplicationGatewaySSLPredefinedPolicyPropertiesFormat +} + +// ApplicationGatewaySSLPredefinedPolicyPropertiesFormat - Properties of ApplicationGatewaySslPredefinedPolicy. +type ApplicationGatewaySSLPredefinedPolicyPropertiesFormat struct { + // Ssl cipher suites to be enabled in the specified order for application gateway. + CipherSuites []*ApplicationGatewaySSLCipherSuite + + // Minimum version of Ssl protocol to be supported on application gateway. + MinProtocolVersion *ApplicationGatewaySSLProtocol +} + +// ApplicationGatewaySSLProfile - SSL profile of an application gateway. +type ApplicationGatewaySSLProfile struct { + // Resource ID. + ID *string + + // Name of the SSL profile that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway SSL profile. + Properties *ApplicationGatewaySSLProfilePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewaySSLProfilePropertiesFormat - Properties of SSL profile of an application gateway. +type ApplicationGatewaySSLProfilePropertiesFormat struct { + // Client authentication configuration of the application gateway resource. + ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration + + // SSL policy of the application gateway resource. + SSLPolicy *ApplicationGatewaySSLPolicy + + // Array of references to application gateway trusted client certificates. + TrustedClientCertificates []*SubResource + + // READ-ONLY; The provisioning state of the HTTP listener resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayTrustedClientCertificate - Trusted client certificates of an application gateway. +type ApplicationGatewayTrustedClientCertificate struct { + // Resource ID. + ID *string + + // Name of the trusted client certificate that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway trusted client certificate. + Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayTrustedClientCertificatePropertiesFormat - Trusted client certificates properties of an application gateway. +type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { + // Certificate public data. + Data *string + + // READ-ONLY; Distinguished name of client certificate issuer. + ClientCertIssuerDN *string + + // READ-ONLY; The provisioning state of the trusted client certificate resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Validated certificate data. + ValidatedCertData *string +} + +// ApplicationGatewayTrustedRootCertificate - Trusted Root certificates of an application gateway. +type ApplicationGatewayTrustedRootCertificate struct { + // Resource ID. + ID *string + + // Name of the trusted root certificate that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway trusted root certificate. + Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayTrustedRootCertificatePropertiesFormat - Trusted Root certificates properties of an application gateway. +type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { + // Certificate public data. + Data *string + + // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + KeyVaultSecretID *string + + // READ-ONLY; The provisioning state of the trusted root certificate resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayURLConfiguration - Url configuration of the Actions set in Application Gateway. +type ApplicationGatewayURLConfiguration struct { + // Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. + ModifiedPath *string + + // Query string which user has provided for url rewrite. Null means no query string will be updated. Default value is null. + ModifiedQueryString *string + + // If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified path. + // Default value is false. + Reroute *bool +} + +// ApplicationGatewayURLPathMap - UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. +type ApplicationGatewayURLPathMap struct { + // Resource ID. + ID *string + + // Name of the URL path map that is unique within an Application Gateway. + Name *string + + // Properties of the application gateway URL path map. + Properties *ApplicationGatewayURLPathMapPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ApplicationGatewayURLPathMapPropertiesFormat - Properties of UrlPathMap of the application gateway. +type ApplicationGatewayURLPathMapPropertiesFormat struct { + // Default backend address pool resource of URL path map. + DefaultBackendAddressPool *SubResource + + // Default backend http settings resource of URL path map. + DefaultBackendHTTPSettings *SubResource + + // Default Load Distribution Policy resource of URL path map. + DefaultLoadDistributionPolicy *SubResource + + // Default redirect configuration resource of URL path map. + DefaultRedirectConfiguration *SubResource + + // Default Rewrite rule set resource of URL path map. + DefaultRewriteRuleSet *SubResource + + // Path rule of URL path map resource. + PathRules []*ApplicationGatewayPathRule + + // READ-ONLY; The provisioning state of the URL path map resource. + ProvisioningState *ProvisioningState +} + +// ApplicationGatewayWafDynamicManifestPropertiesResult - Properties of ApplicationGatewayWafDynamicManifest. +type ApplicationGatewayWafDynamicManifestPropertiesResult struct { + // The available rulesets. + AvailableRuleSets []*ApplicationGatewayFirewallManifestRuleSet + + // The default ruleset. + DefaultRuleSet *DefaultRuleSetPropertyFormat +} + +// ApplicationGatewayWafDynamicManifestResult - Response for ApplicationGatewayWafDynamicManifest API service call. +type ApplicationGatewayWafDynamicManifestResult struct { + // Resource ID. + ID *string + + // Properties of the ApplicationGatewayWafDynamicManifest . + Properties *ApplicationGatewayWafDynamicManifestPropertiesResult + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ApplicationGatewayWafDynamicManifestResultList - Response for ApplicationGatewayWafDynamicManifests API service call. +type ApplicationGatewayWafDynamicManifestResultList struct { + // URL to get the next set of results. + NextLink *string + + // The list of application gateway waf manifest. + Value []*ApplicationGatewayWafDynamicManifestResult +} + +// ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager +// method. +type ApplicationGatewayWafDynamicManifestsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsDefaultClient.Get +// method. +type ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewayWebApplicationFirewallConfiguration - Application gateway web application firewall configuration. +type ApplicationGatewayWebApplicationFirewallConfiguration struct { + // REQUIRED; Whether the web application firewall is enabled or not. + Enabled *bool + + // REQUIRED; Web application firewall mode. + FirewallMode *ApplicationGatewayFirewallMode + + // REQUIRED; The type of the web application firewall rule set. Possible values are: 'OWASP'. + RuleSetType *string + + // REQUIRED; The version of the rule set type. + RuleSetVersion *string + + // The disabled rule groups. + DisabledRuleGroups []*ApplicationGatewayFirewallDisabledRuleGroup + + // The exclusion list. + Exclusions []*ApplicationGatewayFirewallExclusion + + // Maximum file upload size in Mb for WAF. + FileUploadLimitInMb *int32 + + // Maximum request body size for WAF. + MaxRequestBodySize *int32 + + // Maximum request body size in Kb for WAF. + MaxRequestBodySizeInKb *int32 + + // Whether allow WAF to check request Body. + RequestBodyCheck *bool +} + +// ApplicationGatewaysClientBeginBackendHealthOnDemandOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealthOnDemand +// method. +type ApplicationGatewaysClientBeginBackendHealthOnDemandOptions struct { + // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + Expand *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth +// method. +type ApplicationGatewaysClientBeginBackendHealthOptions struct { + // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + Expand *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate +// method. +type ApplicationGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete +// method. +type ApplicationGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart +// method. +type ApplicationGatewaysClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop +// method. +type ApplicationGatewaysClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. +type ApplicationGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy +// method. +type ApplicationGatewaysClientGetSSLPredefinedPolicyOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager +// method. +type ApplicationGatewaysClientListAllOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders +// method. +type ApplicationGatewaysClientListAvailableRequestHeadersOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders +// method. +type ApplicationGatewaysClientListAvailableResponseHeadersOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions +// method. +type ApplicationGatewaysClientListAvailableSSLOptionsOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager +// method. +type ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables +// method. +type ApplicationGatewaysClientListAvailableServerVariablesOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets +// method. +type ApplicationGatewaysClientListAvailableWafRuleSetsOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager method. +type ApplicationGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGatewaysClientUpdateTagsOptions contains the optional parameters for the ApplicationGatewaysClient.UpdateTags +// method. +type ApplicationGatewaysClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ApplicationRule - Rule of type application. +type ApplicationRule struct { + // REQUIRED; Rule Type. + RuleType *FirewallPolicyRuleType + + // Description of the rule. + Description *string + + // List of destination IP addresses or Service Tags. + DestinationAddresses []*string + + // List of FQDN Tags for this rule. + FqdnTags []*string + + // Name of the rule. + Name *string + + // Array of Application Protocols. + Protocols []*FirewallPolicyRuleApplicationProtocol + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string + + // List of FQDNs for this rule. + TargetFqdns []*string + + // List of Urls for this rule condition. + TargetUrls []*string + + // Terminate TLS connections for this rule. + TerminateTLS *bool + + // List of destination azure web categories. + WebCategories []*string +} + +// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type ApplicationRule. +func (a *ApplicationRule) GetFirewallPolicyRule() *FirewallPolicyRule { + return &FirewallPolicyRule{ + Name: a.Name, + Description: a.Description, + RuleType: a.RuleType, + } +} + +// ApplicationSecurityGroup - An application security group in a resource group. +type ApplicationSecurityGroup struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the application security group. + Properties *ApplicationSecurityGroupPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ApplicationSecurityGroupListResult - A list of application security groups. +type ApplicationSecurityGroupListResult struct { + // A list of application security groups. + Value []*ApplicationSecurityGroup + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ApplicationSecurityGroupPropertiesFormat - Application security group properties. +type ApplicationSecurityGroupPropertiesFormat struct { + // READ-ONLY; The provisioning state of the application security group resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even + // if the user changes its name or migrate the resource across subscriptions or resource + // groups. + ResourceGUID *string +} + +// ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate +// method. +type ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete +// method. +type ApplicationSecurityGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get +// method. +type ApplicationSecurityGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager +// method. +type ApplicationSecurityGroupsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager +// method. +type ApplicationSecurityGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationSecurityGroupsClientUpdateTagsOptions contains the optional parameters for the ApplicationSecurityGroupsClient.UpdateTags +// method. +type ApplicationSecurityGroupsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationListResult - Response for ListAuthorizations API service call retrieves all authorizations that belongs to +// an ExpressRouteCircuit. +type AuthorizationListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The authorizations in an ExpressRoute Circuit. + Value []*ExpressRouteCircuitAuthorization +} + +// AuthorizationPropertiesFormat - Properties of ExpressRouteCircuitAuthorization. +type AuthorizationPropertiesFormat struct { + // The authorization key. + AuthorizationKey *string + + // The authorization use status. + AuthorizationUseStatus *AuthorizationUseStatus + + // READ-ONLY; The provisioning state of the authorization resource. + ProvisioningState *ProvisioningState +} + +// AutoApprovedPrivateLinkService - The information of an AutoApprovedPrivateLinkService. +type AutoApprovedPrivateLinkService struct { + // The id of the private link service resource. + PrivateLinkService *string +} + +// AutoApprovedPrivateLinkServicesResult - An array of private link service id that can be linked to a private end point with +// auto approved. +type AutoApprovedPrivateLinkServicesResult struct { + // An array of auto approved private link service. + Value []*AutoApprovedPrivateLinkService + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// Availability of the metric. +type Availability struct { + // Duration of the availability blob. + BlobDuration *string + + // The retention of the availability. + Retention *string + + // The time grain of the availability. + TimeGrain *string +} + +// AvailableDelegation - The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. +type AvailableDelegation struct { + // The actions permitted to the service upon delegation. + Actions []*string + + // A unique identifier of the AvailableDelegation resource. + ID *string + + // The name of the AvailableDelegation resource. + Name *string + + // The name of the service and resource. + ServiceName *string + + // Resource type. + Type *string +} + +// AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager +// method. +type AvailableDelegationsClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailableDelegationsResult - An array of available delegations. +type AvailableDelegationsResult struct { + // An array of available delegations. + Value []*AvailableDelegation + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager +// method. +type AvailableEndpointServicesClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailablePrivateEndpointType - The information of an AvailablePrivateEndpointType. +type AvailablePrivateEndpointType struct { + // Display name of the resource. + DisplayName *string + + // A unique identifier of the AvailablePrivateEndpoint Type resource. + ID *string + + // The name of the service and resource. + Name *string + + // The name of the service and resource. + ResourceName *string + + // Resource type. + Type *string +} + +// AvailablePrivateEndpointTypesClientListByResourceGroupOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager +// method. +type AvailablePrivateEndpointTypesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager +// method. +type AvailablePrivateEndpointTypesClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailablePrivateEndpointTypesResult - An array of available PrivateEndpoint types. +type AvailablePrivateEndpointTypesResult struct { + // An array of available privateEndpoint type. + Value []*AvailablePrivateEndpointType + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// AvailableProvidersList - List of available countries with details. +type AvailableProvidersList struct { + // REQUIRED; List of available countries. + Countries []*AvailableProvidersListCountry +} + +// AvailableProvidersListCity - City or town details. +type AvailableProvidersListCity struct { + // The city or town name. + CityName *string + + // A list of Internet service providers. + Providers []*string +} + +// AvailableProvidersListCountry - Country details. +type AvailableProvidersListCountry struct { + // The country name. + CountryName *string + + // A list of Internet service providers. + Providers []*string + + // List of available states in the country. + States []*AvailableProvidersListState +} + +// AvailableProvidersListParameters - Constraints that determine the list of available Internet service providers. +type AvailableProvidersListParameters struct { + // A list of Azure regions. + AzureLocations []*string + + // The city or town for available providers list. + City *string + + // The country for available providers list. + Country *string + + // The state for available providers list. + State *string +} + +// AvailableProvidersListState - State details. +type AvailableProvidersListState struct { + // List of available cities or towns in the state. + Cities []*AvailableProvidersListCity + + // A list of Internet service providers. + Providers []*string + + // The state name. + StateName *string +} + +// AvailableResourceGroupDelegationsClientListOptions contains the optional parameters for the AvailableResourceGroupDelegationsClient.NewListPager +// method. +type AvailableResourceGroupDelegationsClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailableServiceAlias - The available service alias. +type AvailableServiceAlias struct { + // The ID of the service alias. + ID *string + + // The name of the service alias. + Name *string + + // The resource name of the service alias. + ResourceName *string + + // The type of the resource. + Type *string +} + +// AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager +// method. +type AvailableServiceAliasesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager +// method. +type AvailableServiceAliasesClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailableServiceAliasesResult - An array of available service aliases. +type AvailableServiceAliasesResult struct { + // An array of available service aliases. + Value []*AvailableServiceAlias + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// AzureAsyncOperationResult - The response body contains the status of the specified asynchronous operation, indicating whether +// it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP +// status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response +// body includes the HTTP status code for the successful request. If the +// asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information +// regarding the failure. +type AzureAsyncOperationResult struct { + // Details of the error occurred during specified asynchronous operation. + Error *Error + + // Status of the Azure async operation. + Status *NetworkOperationStatus +} + +// AzureFirewall - Azure Firewall resource. +type AzureFirewall struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the azure firewall. + Properties *AzureFirewallPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting where the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// AzureFirewallApplicationRule - Properties of an application rule. +type AzureFirewallApplicationRule struct { + // Description of the rule. + Description *string + + // List of FQDN Tags for this rule. + FqdnTags []*string + + // Name of the application rule. + Name *string + + // Array of ApplicationRuleProtocols. + Protocols []*AzureFirewallApplicationRuleProtocol + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string + + // List of FQDNs for this rule. + TargetFqdns []*string +} + +// AzureFirewallApplicationRuleCollection - Application rule collection resource. +type AzureFirewallApplicationRuleCollection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + Name *string + + // Properties of the azure firewall application rule collection. + Properties *AzureFirewallApplicationRuleCollectionPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// AzureFirewallApplicationRuleCollectionPropertiesFormat - Properties of the application rule collection. +type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { + // The action type of a rule collection. + Action *AzureFirewallRCAction + + // Priority of the application rule collection resource. + Priority *int32 + + // Collection of rules used by a application rule collection. + Rules []*AzureFirewallApplicationRule + + // READ-ONLY; The provisioning state of the application rule collection resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallApplicationRuleProtocol - Properties of the application rule protocol. +type AzureFirewallApplicationRuleProtocol struct { + // Port number for the protocol, cannot be greater than 64000. This field is optional. + Port *int32 + + // Protocol type. + ProtocolType *AzureFirewallApplicationRuleProtocolType +} + +// AzureFirewallFqdnTag - Azure Firewall FQDN Tag Resource. +type AzureFirewallFqdnTag struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the azure firewall FQDN tag. + Properties *AzureFirewallFqdnTagPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// AzureFirewallFqdnTagListResult - Response for ListAzureFirewallFqdnTags API service call. +type AzureFirewallFqdnTagListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Azure Firewall FQDN Tags in a resource group. + Value []*AzureFirewallFqdnTag +} + +// AzureFirewallFqdnTagPropertiesFormat - Azure Firewall FQDN Tag Properties. +type AzureFirewallFqdnTagPropertiesFormat struct { + // READ-ONLY; The name of this FQDN Tag. + FqdnTagName *string + + // READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager +// method. +type AzureFirewallFqdnTagsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// AzureFirewallIPConfiguration - IP configuration of an Azure Firewall. +type AzureFirewallIPConfiguration struct { + // Resource ID. + ID *string + + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the azure firewall IP configuration. + Properties *AzureFirewallIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// AzureFirewallIPConfigurationPropertiesFormat - Properties of IP configuration of an Azure Firewall. +type AzureFirewallIPConfigurationPropertiesFormat struct { + // Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. + PublicIPAddress *SubResource + + // Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. + Subnet *SubResource + + // READ-ONLY; The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + PrivateIPAddress *string + + // READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallIPGroups - IpGroups associated with azure firewall. +type AzureFirewallIPGroups struct { + // READ-ONLY; The iteration number. + ChangeNumber *string + + // READ-ONLY; Resource ID. + ID *string +} + +// AzureFirewallListResult - Response for ListAzureFirewalls API service call. +type AzureFirewallListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Azure Firewalls in a resource group. + Value []*AzureFirewall +} + +// AzureFirewallNatRCAction - AzureFirewall NAT Rule Collection Action. +type AzureFirewallNatRCAction struct { + // The type of action. + Type *AzureFirewallNatRCActionType +} + +// AzureFirewallNatRule - Properties of a NAT rule. +type AzureFirewallNatRule struct { + // Description of the rule. + Description *string + + // List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. + DestinationAddresses []*string + + // List of destination ports. + DestinationPorts []*string + + // Name of the NAT rule. + Name *string + + // Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + Protocols []*AzureFirewallNetworkRuleProtocol + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string + + // The translated address for this NAT rule. + TranslatedAddress *string + + // The translated FQDN for this NAT rule. + TranslatedFqdn *string + + // The translated port for this NAT rule. + TranslatedPort *string +} + +// AzureFirewallNatRuleCollection - NAT rule collection resource. +type AzureFirewallNatRuleCollection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + Name *string + + // Properties of the azure firewall NAT rule collection. + Properties *AzureFirewallNatRuleCollectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// AzureFirewallNatRuleCollectionProperties - Properties of the NAT rule collection. +type AzureFirewallNatRuleCollectionProperties struct { + // The action type of a NAT rule collection. + Action *AzureFirewallNatRCAction + + // Priority of the NAT rule collection resource. + Priority *int32 + + // Collection of rules used by a NAT rule collection. + Rules []*AzureFirewallNatRule + + // READ-ONLY; The provisioning state of the NAT rule collection resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallNetworkRule - Properties of the network rule. +type AzureFirewallNetworkRule struct { + // Description of the rule. + Description *string + + // List of destination IP addresses. + DestinationAddresses []*string + + // List of destination FQDNs. + DestinationFqdns []*string + + // List of destination IpGroups for this rule. + DestinationIPGroups []*string + + // List of destination ports. + DestinationPorts []*string + + // Name of the network rule. + Name *string + + // Array of AzureFirewallNetworkRuleProtocols. + Protocols []*AzureFirewallNetworkRuleProtocol + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string +} + +// AzureFirewallNetworkRuleCollection - Network rule collection resource. +type AzureFirewallNetworkRuleCollection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + Name *string + + // Properties of the azure firewall network rule collection. + Properties *AzureFirewallNetworkRuleCollectionPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// AzureFirewallNetworkRuleCollectionPropertiesFormat - Properties of the network rule collection. +type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { + // The action type of a rule collection. + Action *AzureFirewallRCAction + + // Priority of the network rule collection resource. + Priority *int32 + + // Collection of rules used by a network rule collection. + Rules []*AzureFirewallNetworkRule + + // READ-ONLY; The provisioning state of the network rule collection resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallPropertiesFormat - Properties of the Azure Firewall. +type AzureFirewallPropertiesFormat struct { + // The additional properties used to further config this azure firewall. + AdditionalProperties map[string]*string + + // Collection of application rule collections used by Azure Firewall. + ApplicationRuleCollections []*AzureFirewallApplicationRuleCollection + + // The firewallPolicy associated with this azure firewall. + FirewallPolicy *SubResource + + // IP addresses associated with AzureFirewall. + HubIPAddresses *HubIPAddresses + + // IP configuration of the Azure Firewall resource. + IPConfigurations []*AzureFirewallIPConfiguration + + // IP configuration of the Azure Firewall used for management traffic. + ManagementIPConfiguration *AzureFirewallIPConfiguration + + // Collection of NAT rule collections used by Azure Firewall. + NatRuleCollections []*AzureFirewallNatRuleCollection + + // Collection of network rule collections used by Azure Firewall. + NetworkRuleCollections []*AzureFirewallNetworkRuleCollection + + // The Azure Firewall Resource SKU. + SKU *AzureFirewallSKU + + // The operation mode for Threat Intelligence. + ThreatIntelMode *AzureFirewallThreatIntelMode + + // The virtualHub to which the firewall belongs. + VirtualHub *SubResource + + // READ-ONLY; IpGroups associated with AzureFirewall. + IPGroups []*AzureFirewallIPGroups + + // READ-ONLY; The provisioning state of the Azure firewall resource. + ProvisioningState *ProvisioningState +} + +// AzureFirewallPublicIPAddress - Public IP Address associated with azure firewall. +type AzureFirewallPublicIPAddress struct { + // Public IP Address value. + Address *string +} + +// AzureFirewallRCAction - Properties of the AzureFirewallRCAction. +type AzureFirewallRCAction struct { + // The type of action. + Type *AzureFirewallRCActionType +} + +// AzureFirewallSKU - SKU of an Azure Firewall. +type AzureFirewallSKU struct { + // Name of an Azure Firewall SKU. + Name *AzureFirewallSKUName + + // Tier of an Azure Firewall. + Tier *AzureFirewallSKUTier +} + +// AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate +// method. +type AzureFirewallsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete method. +type AzureFirewallsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes +// method. +type AzureFirewallsClientBeginListLearnedPrefixesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags +// method. +type AzureFirewallsClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. +type AzureFirewallsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager method. +type AzureFirewallsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.NewListPager method. +type AzureFirewallsClientListOptions struct { + // placeholder for future optional parameters +} + +// AzureReachabilityReport - Azure reachability report details. +type AzureReachabilityReport struct { + // REQUIRED; The aggregation level of Azure reachability report. Can be Country, State or City. + AggregationLevel *string + + // REQUIRED; Parameters that define a geographic location. + ProviderLocation *AzureReachabilityReportLocation + + // REQUIRED; List of Azure reachability report items. + ReachabilityReport []*AzureReachabilityReportItem +} + +// AzureReachabilityReportItem - Azure reachability report details for a given provider location. +type AzureReachabilityReportItem struct { + // The Azure region. + AzureLocation *string + + // List of latency details for each of the time series. + Latencies []*AzureReachabilityReportLatencyInfo + + // The Internet service provider. + Provider *string +} + +// AzureReachabilityReportLatencyInfo - Details on latency for a time series. +type AzureReachabilityReportLatencyInfo struct { + // The relative latency score between 1 and 100, higher values indicating a faster connection. + Score *int32 + + // The time stamp. + TimeStamp *time.Time +} + +// AzureReachabilityReportLocation - Parameters that define a geographic location. +type AzureReachabilityReportLocation struct { + // REQUIRED; The name of the country. + Country *string + + // The name of the city or town. + City *string + + // The name of the state. + State *string +} + +// AzureReachabilityReportParameters - Geographic and time constraints for Azure reachability report. +type AzureReachabilityReportParameters struct { + // REQUIRED; The end time for the Azure reachability report. + EndTime *time.Time + + // REQUIRED; Parameters that define a geographic location. + ProviderLocation *AzureReachabilityReportLocation + + // REQUIRED; The start time for the Azure reachability report. + StartTime *time.Time + + // Optional Azure regions to scope the query to. + AzureLocations []*string + + // List of Internet service providers. + Providers []*string +} + +// AzureWebCategory - Azure Web Category Resource. +type AzureWebCategory struct { + // Resource ID. + ID *string + + // Properties of the Azure Web Category. + Properties *AzureWebCategoryPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// AzureWebCategoryListResult - Response for ListAzureWebCategories API service call. +type AzureWebCategoryListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Azure Web Categories for a given Subscription. + Value []*AzureWebCategory +} + +// AzureWebCategoryPropertiesFormat - Azure Web Category Properties. +type AzureWebCategoryPropertiesFormat struct { + // READ-ONLY; The name of the group that the category belongs to. + Group *string +} + +// BGPCommunity - Contains bgp community information offered in Service Community resources. +type BGPCommunity struct { + // The name of the bgp community. e.g. Skype. + CommunityName *string + + // The prefixes that the bgp community contains. + CommunityPrefixes []*string + + // The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + CommunityValue *string + + // Customer is authorized to use bgp community or not. + IsAuthorizedToUse *bool + + // The service group of the bgp community contains. + ServiceGroup *string + + // The region which the service support. e.g. For O365, region is Global. + ServiceSupportedRegion *string +} + +// BackendAddressInboundNatRulePortMappings - The response for a QueryInboundNatRulePortMapping API. +type BackendAddressInboundNatRulePortMappings struct { + // Collection of inbound NAT rule port mappings. + InboundNatRulePortMappings []*InboundNatRulePortMapping +} + +// BackendAddressPool - Pool of backend IP addresses. +type BackendAddressPool struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can + // be used to access the resource. + Name *string + + // Properties of load balancer backend address pool. + Properties *BackendAddressPoolPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// BackendAddressPoolPropertiesFormat - Properties of the backend address pool. +type BackendAddressPoolPropertiesFormat struct { + // Amount of seconds Load Balancer waits for before sending RESET to client and backend address. + DrainPeriodInSeconds *int32 + + // An array of backend addresses. + LoadBalancerBackendAddresses []*LoadBalancerBackendAddress + + // The location of the backend address pool. + Location *string + + // An array of gateway load balancer tunnel interfaces. + TunnelInterfaces []*GatewayLoadBalancerTunnelInterface + + // A reference to a virtual network. + VirtualNetwork *SubResource + + // READ-ONLY; An array of references to IP addresses defined in network interfaces. + BackendIPConfigurations []*InterfaceIPConfiguration + + // READ-ONLY; An array of references to inbound NAT rules that use this backend address pool. + InboundNatRules []*SubResource + + // READ-ONLY; An array of references to load balancing rules that use this backend address pool. + LoadBalancingRules []*SubResource + + // READ-ONLY; A reference to an outbound rule that uses this backend address pool. + OutboundRule *SubResource + + // READ-ONLY; An array of references to outbound rules that use this backend address pool. + OutboundRules []*SubResource + + // READ-ONLY; The provisioning state of the backend address pool resource. + ProvisioningState *ProvisioningState +} + +// BaseAdminRuleClassification provides polymorphic access to related types. +// Call the interface's GetBaseAdminRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AdminRule, *BaseAdminRule, *DefaultAdminRule +type BaseAdminRuleClassification interface { + // GetBaseAdminRule returns the BaseAdminRule content of the underlying type. + GetBaseAdminRule() *BaseAdminRule +} + +// BaseAdminRule - Network base admin rule. +type BaseAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *AdminRuleKind + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type BaseAdminRule. +func (b *BaseAdminRule) GetBaseAdminRule() *BaseAdminRule { return b } + +// BastionActiveSession - The session detail for a target. +type BastionActiveSession struct { + // READ-ONLY; The protocol used to connect to the target. + Protocol *BastionConnectProtocol + + // READ-ONLY; The type of the resource. + ResourceType *string + + // READ-ONLY; Duration in mins the session has been active. + SessionDurationInMins *float32 + + // READ-ONLY; A unique id for the session. + SessionID *string + + // READ-ONLY; The time when the session started. + StartTime any + + // READ-ONLY; The host name of the target. + TargetHostName *string + + // READ-ONLY; The IP Address of the target. + TargetIPAddress *string + + // READ-ONLY; The resource group of the target. + TargetResourceGroup *string + + // READ-ONLY; The resource id of the target. + TargetResourceID *string + + // READ-ONLY; The subscription id for the target virtual machine. + TargetSubscriptionID *string + + // READ-ONLY; The user name who is active on this session. + UserName *string +} + +// BastionActiveSessionListResult - Response for GetActiveSessions. +type BastionActiveSessionListResult struct { + // The URL to get the next set of results. + NextLink *string + + // List of active sessions on the bastion. + Value []*BastionActiveSession +} + +// BastionHost - Bastion Host resource. +type BastionHost struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Represents the bastion host resource. + Properties *BastionHostPropertiesFormat + + // The sku of this Bastion Host. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// BastionHostIPConfiguration - IP configuration of an Bastion Host. +type BastionHostIPConfiguration struct { + // Resource ID. + ID *string + + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Represents the ip configuration associated with the resource. + Properties *BastionHostIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Ip configuration type. + Type *string +} + +// BastionHostIPConfigurationPropertiesFormat - Properties of IP configuration of an Bastion Host. +type BastionHostIPConfigurationPropertiesFormat struct { + // REQUIRED; Reference of the PublicIP resource. + PublicIPAddress *SubResource + + // REQUIRED; Reference of the subnet resource. + Subnet *SubResource + + // Private IP allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // READ-ONLY; The provisioning state of the bastion host IP configuration resource. + ProvisioningState *ProvisioningState +} + +// BastionHostListResult - Response for ListBastionHosts API service call. +type BastionHostListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Bastion Hosts in a resource group. + Value []*BastionHost +} + +// BastionHostPropertiesFormat - Properties of the Bastion Host. +type BastionHostPropertiesFormat struct { + // FQDN for the endpoint on which bastion host is accessible. + DNSName *string + + // Enable/Disable Copy/Paste feature of the Bastion Host resource. + DisableCopyPaste *bool + + // Enable/Disable File Copy feature of the Bastion Host resource. + EnableFileCopy *bool + + // Enable/Disable IP Connect feature of the Bastion Host resource. + EnableIPConnect *bool + + // Enable/Disable Shareable Link of the Bastion Host resource. + EnableShareableLink *bool + + // Enable/Disable Tunneling feature of the Bastion Host resource. + EnableTunneling *bool + + // IP configuration of the Bastion Host resource. + IPConfigurations []*BastionHostIPConfiguration + + // The scale units for the Bastion Host resource. + ScaleUnits *int32 + + // READ-ONLY; The provisioning state of the bastion host resource. + ProvisioningState *ProvisioningState +} + +// BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate +// method. +type BastionHostsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete method. +type BastionHostsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags method. +type BastionHostsClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. +type BastionHostsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager +// method. +type BastionHostsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// BastionHostsClientListOptions contains the optional parameters for the BastionHostsClient.NewListPager method. +type BastionHostsClientListOptions struct { + // placeholder for future optional parameters +} + +// BastionSessionDeleteResult - Response for DisconnectActiveSessions. +type BastionSessionDeleteResult struct { + // The URL to get the next set of results. + NextLink *string + + // List of sessions with their corresponding state. + Value []*BastionSessionState +} + +// BastionSessionState - The session state detail for a target. +type BastionSessionState struct { + // READ-ONLY; Used for extra information. + Message *string + + // READ-ONLY; A unique id for the session. + SessionID *string + + // READ-ONLY; The state of the session. Disconnected/Failed/NotFound. + State *string +} + +// BastionShareableLink - Bastion Shareable Link. +type BastionShareableLink struct { + // REQUIRED; Reference of the virtual machine resource. + VM *VM + + // READ-ONLY; The unique Bastion Shareable Link to the virtual machine. + Bsl *string + + // READ-ONLY; The time when the link was created. + CreatedAt *string + + // READ-ONLY; Optional field indicating the warning or error message related to the vm in case of partial failure. + Message *string +} + +// BastionShareableLinkListRequest - Post request for all the Bastion Shareable Link endpoints. +type BastionShareableLinkListRequest struct { + // List of VM references. + VMs []*BastionShareableLink +} + +// BastionShareableLinkListResult - Response for all the Bastion Shareable Link endpoints. +type BastionShareableLinkListResult struct { + // The URL to get the next set of results. + NextLink *string + + // List of Bastion Shareable Links for the request. + Value []*BastionShareableLink +} + +// BgpConnection - Virtual Appliance Site resource. +type BgpConnection struct { + // Resource ID. + ID *string + + // Name of the connection. + Name *string + + // The properties of the Bgp connections. + Properties *BgpConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Connection type. + Type *string +} + +// BgpConnectionProperties - Properties of the bgp connection. +type BgpConnectionProperties struct { + // The reference to the HubVirtualNetworkConnection resource. + HubVirtualNetworkConnection *SubResource + + // Peer ASN. + PeerAsn *int64 + + // Peer IP. + PeerIP *string + + // READ-ONLY; The current state of the VirtualHub to Peer. + ConnectionState *HubBgpConnectionStatus + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// BgpPeerStatus - BGP peer status details. +type BgpPeerStatus struct { + // READ-ONLY; The autonomous system number of the remote BGP peer. + Asn *int64 + + // READ-ONLY; For how long the peering has been up. + ConnectedDuration *string + + // READ-ONLY; The virtual network gateway's local address. + LocalAddress *string + + // READ-ONLY; The number of BGP messages received. + MessagesReceived *int64 + + // READ-ONLY; The number of BGP messages sent. + MessagesSent *int64 + + // READ-ONLY; The remote BGP peer. + Neighbor *string + + // READ-ONLY; The number of routes learned from this peer. + RoutesReceived *int64 + + // READ-ONLY; The BGP peer state. + State *BgpPeerState +} + +// BgpPeerStatusListResult - Response for list BGP peer status API service call. +type BgpPeerStatusListResult struct { + // List of BGP peers. + Value []*BgpPeerStatus +} + +// BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager +// method. +type BgpServiceCommunitiesClientListOptions struct { + // placeholder for future optional parameters +} + +// BgpServiceCommunity - Service Community Properties. +type BgpServiceCommunity struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the BGP service community. + Properties *BgpServiceCommunityPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// BgpServiceCommunityListResult - Response for the ListServiceCommunity API service call. +type BgpServiceCommunityListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of service community resources. + Value []*BgpServiceCommunity +} + +// BgpServiceCommunityPropertiesFormat - Properties of Service Community. +type BgpServiceCommunityPropertiesFormat struct { + // A list of bgp communities. + BgpCommunities []*BGPCommunity + + // The name of the bgp community. e.g. Skype. + ServiceName *string +} + +// BgpSettings - BGP settings details. +type BgpSettings struct { + // The BGP speaker's ASN. + Asn *int64 + + // The BGP peering address and BGP identifier of this BGP speaker. + BgpPeeringAddress *string + + // BGP peering address with IP configuration ID for virtual network gateway. + BgpPeeringAddresses []*IPConfigurationBgpPeeringAddress + + // The weight added to routes learned from this BGP speaker. + PeerWeight *int32 +} + +// BreakOutCategoryPolicies - Network Virtual Appliance Sku Properties. +type BreakOutCategoryPolicies struct { + // Flag to control breakout of o365 allow category. + Allow *bool + + // Flag to control breakout of o365 default category. + Default *bool + + // Flag to control breakout of o365 optimize category. + Optimize *bool +} + +// CheckPrivateLinkServiceVisibilityRequest - Request body of the CheckPrivateLinkServiceVisibility API service call. +type CheckPrivateLinkServiceVisibilityRequest struct { + // The alias of the private link service. + PrivateLinkServiceAlias *string +} + +// ChildResource - Proxy resource representation. +type ChildResource struct { + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties struct { + // READ-ONLY; The client id of user assigned identity. + ClientID *string + + // READ-ONLY; The principal id of user assigned identity. + PrincipalID *string +} + +// ConfigurationDiagnosticParameters - Parameters to get network configuration diagnostic. +type ConfigurationDiagnosticParameters struct { + // REQUIRED; List of network configuration diagnostic profiles. + Profiles []*ConfigurationDiagnosticProfile + + // REQUIRED; The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, + // VMSS/NetworkInterface and Application Gateway. + TargetResourceID *string + + // Verbosity level. + VerbosityLevel *VerbosityLevel +} + +// ConfigurationDiagnosticProfile - Parameters to compare with network configuration. +type ConfigurationDiagnosticProfile struct { + // REQUIRED; Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + Destination *string + + // REQUIRED; Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). + DestinationPort *string + + // REQUIRED; The direction of the traffic. + Direction *Direction + + // REQUIRED; Protocol to be verified on. Accepted values are '*', TCP, UDP. + Protocol *string + + // REQUIRED; Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + Source *string +} + +// ConfigurationDiagnosticResponse - Results of network configuration diagnostic on the target resource. +type ConfigurationDiagnosticResponse struct { + // READ-ONLY; List of network configuration diagnostic results. + Results []*ConfigurationDiagnosticResult +} + +// ConfigurationDiagnosticResult - Network configuration diagnostic result corresponded to provided traffic query. +type ConfigurationDiagnosticResult struct { + // Network security group result. + NetworkSecurityGroupResult *SecurityGroupResult + + // Network configuration diagnostic profile. + Profile *ConfigurationDiagnosticProfile +} + +// ConfigurationGroup - The network configuration group resource +type ConfigurationGroup struct { + // Network group ID. + ID *string + + // The network configuration group properties + Properties *GroupProperties +} + +// ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate +// method. +type ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete +// method. +type ConfigurationPolicyGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationPolicyGroupsClientGetOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.Get +// method. +type ConfigurationPolicyGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager +// method. +type ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions struct { + // placeholder for future optional parameters +} + +// ConnectionMonitor - Parameters that define the operation to create a connection monitor. +type ConnectionMonitor struct { + // REQUIRED; Properties of the connection monitor. + Properties *ConnectionMonitorParameters + + // Connection monitor location. + Location *string + + // Connection monitor tags. + Tags map[string]*string +} + +// ConnectionMonitorDestination - Describes the destination of connection monitor. +type ConnectionMonitorDestination struct { + // Address of the connection monitor destination (IP or domain name). + Address *string + + // The destination port used by connection monitor. + Port *int32 + + // The ID of the resource used as the destination by connection monitor. + ResourceID *string +} + +// ConnectionMonitorEndpoint - Describes the connection monitor endpoint. +type ConnectionMonitorEndpoint struct { + // REQUIRED; The name of the connection monitor endpoint. + Name *string + + // Address of the connection monitor endpoint (IP or domain name). + Address *string + + // Test coverage for the endpoint. + CoverageLevel *CoverageLevel + + // Filter for sub-items within the endpoint. + Filter *ConnectionMonitorEndpointFilter + + // Resource ID of the connection monitor endpoint. + ResourceID *string + + // Endpoint scope. + Scope *ConnectionMonitorEndpointScope + + // The endpoint type. + Type *EndpointType +} + +// ConnectionMonitorEndpointFilter - Describes the connection monitor endpoint filter. +type ConnectionMonitorEndpointFilter struct { + // List of items in the filter. + Items []*ConnectionMonitorEndpointFilterItem + + // The behavior of the endpoint filter. Currently only 'Include' is supported. + Type *ConnectionMonitorEndpointFilterType +} + +// ConnectionMonitorEndpointFilterItem - Describes the connection monitor endpoint filter item. +type ConnectionMonitorEndpointFilterItem struct { + // The address of the filter item. + Address *string + + // The type of item included in the filter. Currently only 'AgentAddress' is supported. + Type *ConnectionMonitorEndpointFilterItemType +} + +// ConnectionMonitorEndpointScope - Describes the connection monitor endpoint scope. +type ConnectionMonitorEndpointScope struct { + // List of items which needs to be excluded from the endpoint scope. + Exclude []*ConnectionMonitorEndpointScopeItem + + // List of items which needs to be included to the endpoint scope. + Include []*ConnectionMonitorEndpointScopeItem +} + +// ConnectionMonitorEndpointScopeItem - Describes the connection monitor endpoint scope item. +type ConnectionMonitorEndpointScopeItem struct { + // The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. + Address *string +} + +// ConnectionMonitorHTTPConfiguration - Describes the HTTP configuration. +type ConnectionMonitorHTTPConfiguration struct { + // The HTTP method to use. + Method *HTTPConfigurationMethod + + // The path component of the URI. For instance, "/dir1/dir2". + Path *string + + // The port to connect to. + Port *int32 + + // Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. + PreferHTTPS *bool + + // The HTTP headers to transmit with the request. + RequestHeaders []*HTTPHeader + + // HTTP status codes to consider successful. For instance, "2xx,301-304,418". + ValidStatusCodeRanges []*string +} + +// ConnectionMonitorIcmpConfiguration - Describes the ICMP configuration. +type ConnectionMonitorIcmpConfiguration struct { + // Value indicating whether path evaluation with trace route should be disabled. + DisableTraceRoute *bool +} + +// ConnectionMonitorListResult - List of connection monitors. +type ConnectionMonitorListResult struct { + // Information about connection monitors. + Value []*ConnectionMonitorResult +} + +// ConnectionMonitorOutput - Describes a connection monitor output destination. +type ConnectionMonitorOutput struct { + // Connection monitor output destination type. Currently, only "Workspace" is supported. + Type *OutputType + + // Describes the settings for producing output into a log analytics workspace. + WorkspaceSettings *ConnectionMonitorWorkspaceSettings +} + +// ConnectionMonitorParameters - Parameters that define the operation to create a connection monitor. +type ConnectionMonitorParameters struct { + // Determines if the connection monitor will start automatically once created. + AutoStart *bool + + // Describes the destination of connection monitor. + Destination *ConnectionMonitorDestination + + // List of connection monitor endpoints. + Endpoints []*ConnectionMonitorEndpoint + + // Monitoring interval in seconds. + MonitoringIntervalInSeconds *int32 + + // Optional notes to be associated with the connection monitor. + Notes *string + + // List of connection monitor outputs. + Outputs []*ConnectionMonitorOutput + + // Describes the source of connection monitor. + Source *ConnectionMonitorSource + + // List of connection monitor test configurations. + TestConfigurations []*ConnectionMonitorTestConfiguration + + // List of connection monitor test groups. + TestGroups []*ConnectionMonitorTestGroup +} + +// ConnectionMonitorQueryResult - List of connection states snapshots. +type ConnectionMonitorQueryResult struct { + // Status of connection monitor source. + SourceStatus *ConnectionMonitorSourceStatus + + // Information about connection states. + States []*ConnectionStateSnapshot +} + +// ConnectionMonitorResult - Information about the connection monitor. +type ConnectionMonitorResult struct { + // Connection monitor location. + Location *string + + // Properties of the connection monitor result. + Properties *ConnectionMonitorResultProperties + + // Connection monitor tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; ID of the connection monitor. + ID *string + + // READ-ONLY; Name of the connection monitor. + Name *string + + // READ-ONLY; Connection monitor type. + Type *string +} + +// ConnectionMonitorResultProperties - Describes the properties of a connection monitor. +type ConnectionMonitorResultProperties struct { + // Determines if the connection monitor will start automatically once created. + AutoStart *bool + + // Describes the destination of connection monitor. + Destination *ConnectionMonitorDestination + + // List of connection monitor endpoints. + Endpoints []*ConnectionMonitorEndpoint + + // Monitoring interval in seconds. + MonitoringIntervalInSeconds *int32 + + // Optional notes to be associated with the connection monitor. + Notes *string + + // List of connection monitor outputs. + Outputs []*ConnectionMonitorOutput + + // Describes the source of connection monitor. + Source *ConnectionMonitorSource + + // List of connection monitor test configurations. + TestConfigurations []*ConnectionMonitorTestConfiguration + + // List of connection monitor test groups. + TestGroups []*ConnectionMonitorTestGroup + + // READ-ONLY; Type of connection monitor. + ConnectionMonitorType *ConnectionMonitorType + + // READ-ONLY; The monitoring status of the connection monitor. + MonitoringStatus *string + + // READ-ONLY; The provisioning state of the connection monitor. + ProvisioningState *ProvisioningState + + // READ-ONLY; The date and time when the connection monitor was started. + StartTime *time.Time +} + +// ConnectionMonitorSource - Describes the source of connection monitor. +type ConnectionMonitorSource struct { + // REQUIRED; The ID of the resource used as the source by connection monitor. + ResourceID *string + + // The source port used by connection monitor. + Port *int32 +} + +// ConnectionMonitorSuccessThreshold - Describes the threshold for declaring a test successful. +type ConnectionMonitorSuccessThreshold struct { + // The maximum percentage of failed checks permitted for a test to evaluate as successful. + ChecksFailedPercent *int32 + + // The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. + RoundTripTimeMs *float32 +} + +// ConnectionMonitorTCPConfiguration - Describes the TCP configuration. +type ConnectionMonitorTCPConfiguration struct { + // Destination port behavior. + DestinationPortBehavior *DestinationPortBehavior + + // Value indicating whether path evaluation with trace route should be disabled. + DisableTraceRoute *bool + + // The port to connect to. + Port *int32 +} + +// ConnectionMonitorTestConfiguration - Describes a connection monitor test configuration. +type ConnectionMonitorTestConfiguration struct { + // REQUIRED; The name of the connection monitor test configuration. + Name *string + + // REQUIRED; The protocol to use in test evaluation. + Protocol *ConnectionMonitorTestConfigurationProtocol + + // The parameters used to perform test evaluation over HTTP. + HTTPConfiguration *ConnectionMonitorHTTPConfiguration + + // The parameters used to perform test evaluation over ICMP. + IcmpConfiguration *ConnectionMonitorIcmpConfiguration + + // The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending + // on other parameters. + PreferredIPVersion *PreferredIPVersion + + // The threshold for declaring a test successful. + SuccessThreshold *ConnectionMonitorSuccessThreshold + + // The parameters used to perform test evaluation over TCP. + TCPConfiguration *ConnectionMonitorTCPConfiguration + + // The frequency of test evaluation, in seconds. + TestFrequencySec *int32 +} + +// ConnectionMonitorTestGroup - Describes the connection monitor test group. +type ConnectionMonitorTestGroup struct { + // REQUIRED; List of destination endpoint names. + Destinations []*string + + // REQUIRED; The name of the connection monitor test group. + Name *string + + // REQUIRED; List of source endpoint names. + Sources []*string + + // REQUIRED; List of test configuration names. + TestConfigurations []*string + + // Value indicating whether test group is disabled. + Disable *bool +} + +// ConnectionMonitorWorkspaceSettings - Describes the settings for producing output into a log analytics workspace. +type ConnectionMonitorWorkspaceSettings struct { + // Log analytics workspace resource ID. + WorkspaceResourceID *string +} + +// ConnectionMonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectionMonitorsClient.BeginCreateOrUpdate +// method. +type ConnectionMonitorsClientBeginCreateOrUpdateOptions struct { + // Value indicating whether connection monitor V1 should be migrated to V2 format. + Migrate *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete +// method. +type ConnectionMonitorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery +// method. +type ConnectionMonitorsClientBeginQueryOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart +// method. +type ConnectionMonitorsClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop method. +type ConnectionMonitorsClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectionMonitorsClientGetOptions contains the optional parameters for the ConnectionMonitorsClient.Get method. +type ConnectionMonitorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.NewListPager method. +type ConnectionMonitorsClientListOptions struct { + // placeholder for future optional parameters +} + +// ConnectionMonitorsClientUpdateTagsOptions contains the optional parameters for the ConnectionMonitorsClient.UpdateTags +// method. +type ConnectionMonitorsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ConnectionResetSharedKey - The virtual network connection reset shared key. +type ConnectionResetSharedKey struct { + // REQUIRED; The virtual network connection reset shared key length, should between 1 and 128. + KeyLength *int32 +} + +// ConnectionSharedKey - Response for GetConnectionSharedKey API service call. +type ConnectionSharedKey struct { + // REQUIRED; The virtual network connection shared key value. + Value *string + + // Resource ID. + ID *string +} + +// ConnectionStateSnapshot - Connection state snapshot. +type ConnectionStateSnapshot struct { + // Average latency in ms. + AvgLatencyInMs *int64 + + // The connection state. + ConnectionState *ConnectionState + + // The end time of the connection snapshot. + EndTime *time.Time + + // Connectivity analysis evaluation state. + EvaluationState *EvaluationState + + // Maximum latency in ms. + MaxLatencyInMs *int64 + + // Minimum latency in ms. + MinLatencyInMs *int64 + + // The number of failed probes. + ProbesFailed *int64 + + // The number of sent probes. + ProbesSent *int64 + + // The start time of the connection snapshot. + StartTime *time.Time + + // READ-ONLY; List of hops between the source and the destination. + Hops []*ConnectivityHop +} + +// ConnectivityConfiguration - The network manager connectivity configuration resource +type ConnectivityConfiguration struct { + // Properties of a network manager connectivity configuration + Properties *ConnectivityConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// ConnectivityConfigurationListResult - Result of the request to list network manager connectivity configurations. It contains +// a list of configurations and a link to get the next set of results. +type ConnectivityConfigurationListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of Connectivity Configurations + Value []*ConnectivityConfiguration +} + +// ConnectivityConfigurationProperties - Properties of network manager connectivity configuration +type ConnectivityConfigurationProperties struct { + // REQUIRED; Groups for configuration + AppliesToGroups []*ConnectivityGroupItem + + // REQUIRED; Connectivity topology type. + ConnectivityTopology *ConnectivityTopology + + // Flag if need to remove current existing peerings. + DeleteExistingPeering *DeleteExistingPeering + + // A description of the connectivity configuration. + Description *string + + // List of hubItems + Hubs []*Hub + + // Flag if global mesh is supported. + IsGlobal *IsGlobal + + // READ-ONLY; The provisioning state of the connectivity configuration resource. + ProvisioningState *ProvisioningState +} + +// ConnectivityConfigurationsClientBeginDeleteOptions contains the optional parameters for the ConnectivityConfigurationsClient.BeginDelete +// method. +type ConnectivityConfigurationsClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectivityConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConnectivityConfigurationsClient.CreateOrUpdate +// method. +type ConnectivityConfigurationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConnectivityConfigurationsClientGetOptions contains the optional parameters for the ConnectivityConfigurationsClient.Get +// method. +type ConnectivityConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.NewListPager +// method. +type ConnectivityConfigurationsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ConnectivityDestination - Parameters that define destination of connection. +type ConnectivityDestination struct { + // The IP address or URI the resource to which a connection attempt will be made. + Address *string + + // Port on which check connectivity will be performed. + Port *int32 + + // The ID of the resource to which a connection attempt will be made. + ResourceID *string +} + +// ConnectivityGroupItem - Connectivity group item. +type ConnectivityGroupItem struct { + // REQUIRED; Group connectivity type. + GroupConnectivity *GroupConnectivity + + // REQUIRED; Network group Id. + NetworkGroupID *string + + // Flag if global is supported. + IsGlobal *IsGlobal + + // Flag if need to use hub gateway. + UseHubGateway *UseHubGateway +} + +// ConnectivityHop - Information about a hop between the source and the destination. +type ConnectivityHop struct { + // READ-ONLY; The IP address of the hop. + Address *string + + // READ-ONLY; The ID of the hop. + ID *string + + // READ-ONLY; List of issues. + Issues []*ConnectivityIssue + + // READ-ONLY; List of hop links. + Links []*HopLink + + // READ-ONLY; List of next hop identifiers. + NextHopIDs []*string + + // READ-ONLY; List of previous hop identifiers. + PreviousHopIDs []*string + + // READ-ONLY; List of previous hop links. + PreviousLinks []*HopLink + + // READ-ONLY; The ID of the resource corresponding to this hop. + ResourceID *string + + // READ-ONLY; The type of the hop. + Type *string +} + +// ConnectivityInformation - Information on the connectivity status. +type ConnectivityInformation struct { + // READ-ONLY; Average latency in milliseconds. + AvgLatencyInMs *int32 + + // READ-ONLY; The connection status. + ConnectionStatus *ConnectionStatus + + // READ-ONLY; List of hops between the source and the destination. + Hops []*ConnectivityHop + + // READ-ONLY; Maximum latency in milliseconds. + MaxLatencyInMs *int32 + + // READ-ONLY; Minimum latency in milliseconds. + MinLatencyInMs *int32 + + // READ-ONLY; Number of failed probes. + ProbesFailed *int32 + + // READ-ONLY; Total number of probes sent. + ProbesSent *int32 +} + +// ConnectivityIssue - Information about an issue encountered in the process of checking for connectivity. +type ConnectivityIssue struct { + // READ-ONLY; Provides additional context on the issue. + Context []map[string]*string + + // READ-ONLY; The origin of the issue. + Origin *Origin + + // READ-ONLY; The severity of the issue. + Severity *Severity + + // READ-ONLY; The type of issue. + Type *IssueType +} + +// ConnectivityParameters - Parameters that determine how the connectivity check will be performed. +type ConnectivityParameters struct { + // REQUIRED; The destination of connection. + Destination *ConnectivityDestination + + // REQUIRED; The source of the connection. + Source *ConnectivitySource + + // Preferred IP version of the connection. + PreferredIPVersion *IPVersion + + // Network protocol. + Protocol *Protocol + + // Configuration of the protocol. + ProtocolConfiguration *ProtocolConfiguration +} + +// ConnectivitySource - Parameters that define the source of the connection. +type ConnectivitySource struct { + // REQUIRED; The ID of the resource from which a connectivity check will be initiated. + ResourceID *string + + // The source port from which a connectivity check will be performed. + Port *int32 +} + +// Container - Reference to container resource in remote resource provider. +type Container struct { + // Resource ID. + ID *string +} + +// ContainerNetworkInterface - Container network interface child resource. +type ContainerNetworkInterface struct { + // Resource ID. + ID *string + + // The name of the resource. This name can be used to access the resource. + Name *string + + // Container network interface properties. + Properties *ContainerNetworkInterfacePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Sub Resource type. + Type *string +} + +// ContainerNetworkInterfaceConfiguration - Container network interface configuration child resource. +type ContainerNetworkInterfaceConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource. This name can be used to access the resource. + Name *string + + // Container network interface configuration properties. + Properties *ContainerNetworkInterfaceConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Sub Resource type. + Type *string +} + +// ContainerNetworkInterfaceConfigurationPropertiesFormat - Container network interface configuration properties. +type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { + // A list of container network interfaces created from this container network interface configuration. + ContainerNetworkInterfaces []*SubResource + + // A list of ip configurations of the container network interface configuration. + IPConfigurations []*IPConfigurationProfile + + // READ-ONLY; The provisioning state of the container network interface configuration resource. + ProvisioningState *ProvisioningState +} + +// ContainerNetworkInterfaceIPConfiguration - The ip configuration for a container network interface. +type ContainerNetworkInterfaceIPConfiguration struct { + // The name of the resource. This name can be used to access the resource. + Name *string + + // Properties of the container network interface IP configuration. + Properties *ContainerNetworkInterfaceIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Sub Resource type. + Type *string +} + +// ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. +type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { + // READ-ONLY; The provisioning state of the container network interface IP configuration resource. + ProvisioningState *ProvisioningState +} + +// ContainerNetworkInterfacePropertiesFormat - Properties of container network interface. +type ContainerNetworkInterfacePropertiesFormat struct { + // Reference to the container to which this container network interface is attached. + Container *Container + + // READ-ONLY; Container network interface configuration from which this container network interface is created. + ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration + + // READ-ONLY; Reference to the ip configuration on this container nic. + IPConfigurations []*ContainerNetworkInterfaceIPConfiguration + + // READ-ONLY; The provisioning state of the container network interface resource. + ProvisioningState *ProvisioningState +} + +// Criterion - A matching criteria which matches routes based on route prefix, community, and AS path. +type Criterion struct { + // List of AS paths which this criteria matches. + AsPath []*string + + // List of BGP communities which this criteria matches. + Community []*string + + // Match condition to apply RouteMap rules. + MatchCondition *RouteMapMatchCondition + + // List of route prefixes which this criteria matches. + RoutePrefix []*string +} + +// CrossTenantScopes - Cross tenant scopes. +type CrossTenantScopes struct { + // READ-ONLY; List of management groups. + ManagementGroups []*string + + // READ-ONLY; List of subscriptions. + Subscriptions []*string + + // READ-ONLY; Tenant ID. + TenantID *string +} + +// CustomDNSConfigPropertiesFormat - Contains custom Dns resolution configuration from customer. +type CustomDNSConfigPropertiesFormat struct { + // Fqdn that resolves to private endpoint ip address. + Fqdn *string + + // A list of private ip addresses of the private endpoint. + IPAddresses []*string +} + +// CustomIPPrefix - Custom IP prefix resource. +type CustomIPPrefix struct { + // The extended location of the custom IP prefix. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Custom IP prefix properties. + Properties *CustomIPPrefixPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// CustomIPPrefixListResult - Response for ListCustomIpPrefixes API service call. +type CustomIPPrefixListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of Custom IP prefixes that exists in a resource group. + Value []*CustomIPPrefix +} + +// CustomIPPrefixPropertiesFormat - Custom IP prefix properties. +type CustomIPPrefixPropertiesFormat struct { + // The ASN for CIDR advertising. Should be an integer as string. + Asn *string + + // Authorization message for WAN validation. + AuthorizationMessage *string + + // The prefix range in CIDR notation. Should include the start address and the prefix length. + Cidr *string + + // The commissioned state of the Custom IP Prefix. + CommissionedState *CommissionedState + + // The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + CustomIPPrefixParent *SubResource + + // Whether to do express route advertise. + ExpressRouteAdvertise *bool + + // The Geo for CIDR advertising. Should be an Geo code. + Geo *Geo + + // Whether to Advertise the range to Internet. + NoInternetAdvertise *bool + + // Type of custom IP prefix. Should be Singular, Parent, or Child. + PrefixType *CustomIPPrefixType + + // Signed message for WAN validation. + SignedMessage *string + + // READ-ONLY; The list of all Children for IPv6 /48 CustomIpPrefix. + ChildCustomIPPrefixes []*SubResource + + // READ-ONLY; The reason why resource is in failed state. + FailedReason *string + + // READ-ONLY; The provisioning state of the custom IP prefix resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The list of all referenced PublicIpPrefixes. + PublicIPPrefixes []*SubResource + + // READ-ONLY; The resource GUID property of the custom IP prefix resource. + ResourceGUID *string +} + +// CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate +// method. +type CustomIPPrefixesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete method. +type CustomIPPrefixesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. +type CustomIPPrefixesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager method. +type CustomIPPrefixesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager method. +type CustomIPPrefixesClientListOptions struct { + // placeholder for future optional parameters +} + +// CustomIPPrefixesClientUpdateTagsOptions contains the optional parameters for the CustomIPPrefixesClient.UpdateTags method. +type CustomIPPrefixesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// DNSNameAvailabilityResult - Response for the CheckDnsNameAvailability API service call. +type DNSNameAvailabilityResult struct { + // Domain availability (True/False). + Available *bool +} + +// DNSSettings - DNS Proxy Settings in Firewall Policy. +type DNSSettings struct { + // Enable DNS Proxy on Firewalls attached to the Firewall Policy. + EnableProxy *bool + + // FQDNs in Network Rules are supported when set to true. + RequireProxyForNetworkRules *bool + + // List of Custom DNS Servers. + Servers []*string +} + +// DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate +// method. +type DdosCustomPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete +// method. +type DdosCustomPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. +type DdosCustomPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DdosCustomPoliciesClientUpdateTagsOptions contains the optional parameters for the DdosCustomPoliciesClient.UpdateTags +// method. +type DdosCustomPoliciesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// DdosCustomPolicy - A DDoS custom policy in a resource group. +type DdosCustomPolicy struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the DDoS custom policy. + Properties *DdosCustomPolicyPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// DdosCustomPolicyPropertiesFormat - DDoS custom policy properties. +type DdosCustomPolicyPropertiesFormat struct { + // READ-ONLY; The provisioning state of the DDoS custom policy resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if + // the user changes its name or migrate the resource across subscriptions or resource groups. + ResourceGUID *string +} + +// DdosProtectionPlan - A DDoS protection plan in a resource group. +type DdosProtectionPlan struct { + // Resource location. + Location *string + + // Properties of the DDoS protection plan. + Properties *DdosProtectionPlanPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// DdosProtectionPlanListResult - A list of DDoS protection plans. +type DdosProtectionPlanListResult struct { + // A list of DDoS protection plans. + Value []*DdosProtectionPlan + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// DdosProtectionPlanPropertiesFormat - DDoS protection plan properties. +type DdosProtectionPlanPropertiesFormat struct { + // READ-ONLY; The provisioning state of the DDoS protection plan resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The list of public IPs associated with the DDoS protection plan resource. This list is read-only. + PublicIPAddresses []*SubResource + + // READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if + // the user changes its name or migrate the resource across subscriptions or resource groups. + ResourceGUID *string + + // READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + VirtualNetworks []*SubResource +} + +// DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate +// method. +type DdosProtectionPlansClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete +// method. +type DdosProtectionPlansClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. +type DdosProtectionPlansClientGetOptions struct { + // placeholder for future optional parameters +} + +// DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager +// method. +type DdosProtectionPlansClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager method. +type DdosProtectionPlansClientListOptions struct { + // placeholder for future optional parameters +} + +// DdosProtectionPlansClientUpdateTagsOptions contains the optional parameters for the DdosProtectionPlansClient.UpdateTags +// method. +type DdosProtectionPlansClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// DdosSettings - Contains the DDoS protection settings of the public IP. +type DdosSettings struct { + // The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled + DdosProtectionPlan *SubResource + + // The DDoS protection mode of the public IP + ProtectionMode *DdosSettingsProtectionMode +} + +// DefaultAdminPropertiesFormat - Security default admin rule resource. +type DefaultAdminPropertiesFormat struct { + // Default rule flag. + Flag *string + + // READ-ONLY; Indicates the access allowed for this particular rule + Access *SecurityConfigurationRuleAccess + + // READ-ONLY; A description for this rule. Restricted to 140 chars. + Description *string + + // READ-ONLY; The destination port ranges. + DestinationPortRanges []*string + + // READ-ONLY; The destination address prefixes. CIDR or destination IP ranges. + Destinations []*AddressPrefixItem + + // READ-ONLY; Indicates if the traffic matched against the rule in inbound or outbound. + Direction *SecurityConfigurationRuleDirection + + // READ-ONLY; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule + // in the collection. The lower the priority number, the higher the priority of the rule. + Priority *int32 + + // READ-ONLY; Network protocol this rule applies to. + Protocol *SecurityConfigurationRuleProtocol + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The source port ranges. + SourcePortRanges []*string + + // READ-ONLY; The CIDR or source IP ranges. + Sources []*AddressPrefixItem +} + +// DefaultAdminRule - Network default admin rule. +type DefaultAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *AdminRuleKind + + // Indicates the properties of the security admin rule + Properties *DefaultAdminPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// GetBaseAdminRule implements the BaseAdminRuleClassification interface for type DefaultAdminRule. +func (d *DefaultAdminRule) GetBaseAdminRule() *BaseAdminRule { + return &BaseAdminRule{ + Kind: d.Kind, + SystemData: d.SystemData, + ID: d.ID, + Name: d.Name, + Type: d.Type, + Etag: d.Etag, + } +} + +// DefaultRuleSetPropertyFormat - the default web application firewall rule set. +type DefaultRuleSetPropertyFormat struct { + // The type of the web application firewall rule set. + RuleSetType *string + + // The version of the web application firewall rule set type. + RuleSetVersion *string +} + +// DefaultSecurityRulesClientGetOptions contains the optional parameters for the DefaultSecurityRulesClient.Get method. +type DefaultSecurityRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.NewListPager +// method. +type DefaultSecurityRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// Delegation - Details the service to which the subnet is delegated. +type Delegation struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a subnet. This name can be used to access the resource. + Name *string + + // Properties of the subnet. + Properties *ServiceDelegationPropertiesFormat + + // Resource type. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// DelegationProperties - Properties of the delegation. +type DelegationProperties struct { + // The service name to which the NVA is delegated. + ServiceName *string + + // READ-ONLY; The current provisioning state. + ProvisioningState *ProvisioningState +} + +// DeviceProperties - List of properties of the device. +type DeviceProperties struct { + // Model of the device. + DeviceModel *string + + // Name of the device Vendor. + DeviceVendor *string + + // Link speed. + LinkSpeedInMbps *int32 +} + +// DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for +// a subnet overrides VNET DHCP options. +type DhcpOptions struct { + // The list of DNS servers IP addresses. + DNSServers []*string +} + +// Dimension of the metric. +type Dimension struct { + // The display name of the dimension. + DisplayName *string + + // The internal name of the dimension. + InternalName *string + + // The name of the dimension. + Name *string +} + +// DscpConfiguration - Differentiated Services Code Point configuration for any given network interface +type DscpConfiguration struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the network interface. + Properties *DscpConfigurationPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate +// method. +type DscpConfigurationClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete +// method. +type DscpConfigurationClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. +type DscpConfigurationClientGetOptions struct { + // placeholder for future optional parameters +} + +// DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager +// method. +type DscpConfigurationClientListAllOptions struct { + // placeholder for future optional parameters +} + +// DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager method. +type DscpConfigurationClientListOptions struct { + // placeholder for future optional parameters +} + +// DscpConfigurationListResult - Response for the DscpConfigurationList API service call. +type DscpConfigurationListResult struct { + // A list of dscp configurations in a resource group. + Value []*DscpConfiguration + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// DscpConfigurationPropertiesFormat - Differentiated Services Code Point configuration properties. +type DscpConfigurationPropertiesFormat struct { + // Destination IP ranges. + DestinationIPRanges []*QosIPRange + + // Destination port ranges. + DestinationPortRanges []*QosPortRange + + // List of markings to be used in the configuration. + Markings []*int32 + + // RNM supported protocol types. + Protocol *ProtocolType + + // QoS object definitions + QosDefinitionCollection []*QosDefinition + + // Source IP ranges. + SourceIPRanges []*QosIPRange + + // Sources port ranges. + SourcePortRanges []*QosPortRange + + // READ-ONLY; Associated Network Interfaces to the DSCP Configuration. + AssociatedNetworkInterfaces []*Interface + + // READ-ONLY; The provisioning state of the DSCP Configuration resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Qos Collection ID generated by RNM. + QosCollectionID *string + + // READ-ONLY; The resource GUID property of the DSCP Configuration resource. + ResourceGUID *string +} + +// EffectiveBaseSecurityAdminRuleClassification provides polymorphic access to related types. +// Call the interface's GetEffectiveBaseSecurityAdminRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EffectiveBaseSecurityAdminRule, *EffectiveDefaultSecurityAdminRule, *EffectiveSecurityAdminRule +type EffectiveBaseSecurityAdminRuleClassification interface { + // GetEffectiveBaseSecurityAdminRule returns the EffectiveBaseSecurityAdminRule content of the underlying type. + GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule +} + +// EffectiveBaseSecurityAdminRule - Network base admin rule. +type EffectiveBaseSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveBaseSecurityAdminRule. +func (e *EffectiveBaseSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { + return e +} + +// EffectiveConnectivityConfiguration - The network manager effective connectivity configuration +type EffectiveConnectivityConfiguration struct { + // Effective configuration groups. + ConfigurationGroups []*ConfigurationGroup + + // Connectivity configuration ID. + ID *string + + // Properties of a network manager connectivity configuration + Properties *ConnectivityConfigurationProperties +} + +// EffectiveDefaultSecurityAdminRule - Network default admin rule. +type EffectiveDefaultSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Indicates the properties of the default security admin rule + Properties *DefaultAdminPropertiesFormat + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveDefaultSecurityAdminRule. +func (e *EffectiveDefaultSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { + return &EffectiveBaseSecurityAdminRule{ + ID: e.ID, + ConfigurationDescription: e.ConfigurationDescription, + RuleCollectionDescription: e.RuleCollectionDescription, + RuleCollectionAppliesToGroups: e.RuleCollectionAppliesToGroups, + RuleGroups: e.RuleGroups, + Kind: e.Kind, + } +} + +// EffectiveNetworkSecurityGroup - Effective network security group. +type EffectiveNetworkSecurityGroup struct { + // Associated resources. + Association *EffectiveNetworkSecurityGroupAssociation + + // A collection of effective security rules. + EffectiveSecurityRules []*EffectiveNetworkSecurityRule + + // The ID of network security group that is applied. + NetworkSecurityGroup *SubResource + + // Mapping of tags to list of IP Addresses included within the tag. + TagMap *string +} + +// EffectiveNetworkSecurityGroupAssociation - The effective network security group association. +type EffectiveNetworkSecurityGroupAssociation struct { + // The ID of the network interface if assigned. + NetworkInterface *SubResource + + // The ID of the Azure network manager if assigned. + NetworkManager *SubResource + + // The ID of the subnet if assigned. + Subnet *SubResource +} + +// EffectiveNetworkSecurityGroupListResult - Response for list effective network security groups API service call. +type EffectiveNetworkSecurityGroupListResult struct { + // A list of effective network security groups. + Value []*EffectiveNetworkSecurityGroup + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// EffectiveNetworkSecurityRule - Effective network security rules. +type EffectiveNetworkSecurityRule struct { + // Whether network traffic is allowed or denied. + Access *SecurityRuleAccess + + // The destination address prefix. + DestinationAddressPrefix *string + + // The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, + // Internet), System Tags, and the asterisk (*). + DestinationAddressPrefixes []*string + + // The destination port or range. + DestinationPortRange *string + + // The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator + // (e.g. 100-400), or an asterisk (*). + DestinationPortRanges []*string + + // The direction of the rule. + Direction *SecurityRuleDirection + + // Expanded destination address prefix. + ExpandedDestinationAddressPrefix []*string + + // The expanded source address prefix. + ExpandedSourceAddressPrefix []*string + + // The name of the security rule specified by the user (if created by the user). + Name *string + + // The priority of the rule. + Priority *int32 + + // The network protocol this rule applies to. + Protocol *EffectiveSecurityRuleProtocol + + // The source address prefix. + SourceAddressPrefix *string + + // The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), + // System Tags, and the asterisk (*). + SourceAddressPrefixes []*string + + // The source port or range. + SourcePortRange *string + + // The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. + // 100-400), or an asterisk (*). + SourcePortRanges []*string +} + +// EffectiveRoute - Effective Route. +type EffectiveRoute struct { + // The address prefixes of the effective routes in CIDR notation. + AddressPrefix []*string + + // If true, on-premises routes are not propagated to the network interfaces in the subnet. + DisableBgpRoutePropagation *bool + + // The name of the user defined route. This is optional. + Name *string + + // The IP address of the next hop of the effective route. + NextHopIPAddress []*string + + // The type of Azure hop the packet should be sent to. + NextHopType *RouteNextHopType + + // Who created the route. + Source *EffectiveRouteSource + + // The value of effective route. + State *EffectiveRouteState +} + +// EffectiveRouteListResult - Response for list effective route API service call. +type EffectiveRouteListResult struct { + // A list of effective routes. + Value []*EffectiveRoute + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// EffectiveRouteMapRoute - The effective RouteMap route configured on the connection resource. +type EffectiveRouteMapRoute struct { + // The ASPath of this route. + AsPath *string + + // BGP communities of the route. + BgpCommunities *string + + // The address prefix of the route. + Prefix []*string +} + +// EffectiveRoutesParameters - The parameters specifying the resource whose effective routes are being requested. +type EffectiveRoutesParameters struct { + // The resource whose effective routes are being requested. + ResourceID *string + + // The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection + // and P2SConnection. + VirtualWanResourceType *string +} + +// EffectiveSecurityAdminRule - Network admin rule. +type EffectiveSecurityAdminRule struct { + // REQUIRED; Whether the rule is custom or default. + Kind *EffectiveAdminRuleKind + + // A description of the security admin configuration. + ConfigurationDescription *string + + // Resource ID. + ID *string + + // Indicates the properties of the security admin rule + Properties *AdminPropertiesFormat + + // Groups for rule collection + RuleCollectionAppliesToGroups []*ManagerSecurityGroupItem + + // A description of the rule collection. + RuleCollectionDescription *string + + // Effective configuration groups. + RuleGroups []*ConfigurationGroup +} + +// GetEffectiveBaseSecurityAdminRule implements the EffectiveBaseSecurityAdminRuleClassification interface for type EffectiveSecurityAdminRule. +func (e *EffectiveSecurityAdminRule) GetEffectiveBaseSecurityAdminRule() *EffectiveBaseSecurityAdminRule { + return &EffectiveBaseSecurityAdminRule{ + ID: e.ID, + ConfigurationDescription: e.ConfigurationDescription, + RuleCollectionDescription: e.RuleCollectionDescription, + RuleCollectionAppliesToGroups: e.RuleCollectionAppliesToGroups, + RuleGroups: e.RuleGroups, + Kind: e.Kind, + } +} + +// EndpointServiceResult - Endpoint service. +type EndpointServiceResult struct { + // Resource ID. + ID *string + + // READ-ONLY; Name of the endpoint service. + Name *string + + // READ-ONLY; Type of the endpoint service. + Type *string +} + +// EndpointServicesListResult - Response for the ListAvailableEndpointServices API service call. +type EndpointServicesListResult struct { + // The URL to get the next set of results. + NextLink *string + + // List of available endpoint services in a region. + Value []*EndpointServiceResult +} + +// Error - Common error representation. +type Error struct { + // Error code. + Code *string + + // Error details. + Details []*ErrorDetails + + // Inner error message. + InnerError *string + + // Error message. + Message *string + + // Error target. + Target *string +} + +// ErrorDetails - Common error details representation. +type ErrorDetails struct { + // Error code. + Code *string + + // Error message. + Message *string + + // Error target. + Target *string +} + +// ErrorResponse - The error object. +type ErrorResponse struct { + // The error details object. + Error *ErrorDetails +} + +// EvaluatedNetworkSecurityGroup - Results of network security group evaluation. +type EvaluatedNetworkSecurityGroup struct { + // Resource ID of nic or subnet to which network security group is applied. + AppliedTo *string + + // Matched network security rule. + MatchedRule *MatchedRule + + // Network security group ID. + NetworkSecurityGroupID *string + + // READ-ONLY; List of network security rules evaluation results. + RulesEvaluationResult []*SecurityRulesEvaluationResult +} + +// ExclusionManagedRule - Defines a managed rule to use for exclusion. +type ExclusionManagedRule struct { + // REQUIRED; Identifier for the managed rule. + RuleID *string +} + +// ExclusionManagedRuleGroup - Defines a managed rule group to use for exclusion. +type ExclusionManagedRuleGroup struct { + // REQUIRED; The managed rule group for exclusion. + RuleGroupName *string + + // List of rules that will be excluded. If none specified, all rules in the group will be excluded. + Rules []*ExclusionManagedRule +} + +// ExclusionManagedRuleSet - Defines a managed rule set for Exclusions. +type ExclusionManagedRuleSet struct { + // REQUIRED; Defines the rule set type to use. + RuleSetType *string + + // REQUIRED; Defines the version of the rule set to use. + RuleSetVersion *string + + // Defines the rule groups to apply to the rule set. + RuleGroups []*ExclusionManagedRuleGroup +} + +// ExplicitProxySettings - Explicit Proxy Settings in Firewall Policy. +type ExplicitProxySettings struct { + // When set to true, explicit proxy mode is enabled. + EnableExplicitProxy *bool + + // When set to true, pac file port and url needs to be provided. + EnablePacFile *bool + + // Port number for explicit proxy http protocol, cannot be greater than 64000. + HTTPPort *int32 + + // Port number for explicit proxy https protocol, cannot be greater than 64000. + HTTPSPort *int32 + + // SAS URL for PAC file. + PacFile *string + + // Port number for firewall to serve PAC file. + PacFilePort *int32 +} + +// ExpressRouteCircuit resource. +type ExpressRouteCircuit struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the express route circuit. + Properties *ExpressRouteCircuitPropertiesFormat + + // The SKU. + SKU *ExpressRouteCircuitSKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRouteCircuitArpTable - The ARP table associated with the ExpressRouteCircuit. +type ExpressRouteCircuitArpTable struct { + // Entry age in minutes. + Age *int32 + + // The IP address. + IPAddress *string + + // Interface address. + Interface *string + + // The MAC address. + MacAddress *string +} + +// ExpressRouteCircuitAuthorization - Authorization in an ExpressRouteCircuit resource. +type ExpressRouteCircuitAuthorization struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the express route circuit authorization. + Properties *AuthorizationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete +// method. +type ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitAuthorizationsClientGetOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.Get +// method. +type ExpressRouteCircuitAuthorizationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager +// method. +type ExpressRouteCircuitAuthorizationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitConnection - Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. +type ExpressRouteCircuitConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the express route circuit connection. + Properties *ExpressRouteCircuitConnectionPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ExpressRouteCircuitConnectionListResult - Response for ListConnections API service call retrieves all global reach connections +// that belongs to a Private Peering for an ExpressRouteCircuit. +type ExpressRouteCircuitConnectionListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The global reach connection associated with Private Peering in an ExpressRoute Circuit. + Value []*ExpressRouteCircuitConnection +} + +// ExpressRouteCircuitConnectionPropertiesFormat - Properties of the express route circuit connection. +type ExpressRouteCircuitConnectionPropertiesFormat struct { + // /29 IP address space to carve out Customer addresses for tunnels. + AddressPrefix *string + + // The authorization key. + AuthorizationKey *string + + // Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + ExpressRouteCircuitPeering *SubResource + + // IPv6 Address PrefixProperties of the express route circuit connection. + IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig + + // Reference to Express Route Circuit Private Peering Resource of the peered circuit. + PeerExpressRouteCircuitPeering *SubResource + + // READ-ONLY; Express Route Circuit connection state. + CircuitConnectionStatus *CircuitConnectionStatus + + // READ-ONLY; The provisioning state of the express route circuit connection resource. + ProvisioningState *ProvisioningState +} + +// ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete +// method. +type ExpressRouteCircuitConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.Get +// method. +type ExpressRouteCircuitConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.NewListPager +// method. +type ExpressRouteCircuitConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitListResult - Response for ListExpressRouteCircuit API service call. +type ExpressRouteCircuitListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of ExpressRouteCircuits in a resource group. + Value []*ExpressRouteCircuit +} + +// ExpressRouteCircuitPeering - Peering in an ExpressRouteCircuit resource. +type ExpressRouteCircuitPeering struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the express route circuit peering. + Properties *ExpressRouteCircuitPeeringPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ExpressRouteCircuitPeeringConfig - Specifies the peering configuration. +type ExpressRouteCircuitPeeringConfig struct { + // The communities of bgp peering. Specified for microsoft peering. + AdvertisedCommunities []*string + + // The reference to AdvertisedPublicPrefixes. + AdvertisedPublicPrefixes []*string + + // The CustomerASN of the peering. + CustomerASN *int32 + + // The legacy mode of the peering. + LegacyMode *int32 + + // The RoutingRegistryName of the configuration. + RoutingRegistryName *string + + // READ-ONLY; The advertised public prefix state of the Peering resource. + AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState +} + +// ExpressRouteCircuitPeeringID - ExpressRoute circuit peering identifier. +type ExpressRouteCircuitPeeringID struct { + // The ID of the ExpressRoute circuit peering. + ID *string +} + +// ExpressRouteCircuitPeeringListResult - Response for ListPeering API service call retrieves all peerings that belong to +// an ExpressRouteCircuit. +type ExpressRouteCircuitPeeringListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The peerings in an express route circuit. + Value []*ExpressRouteCircuitPeering +} + +// ExpressRouteCircuitPeeringPropertiesFormat - Properties of the express route circuit peering. +type ExpressRouteCircuitPeeringPropertiesFormat struct { + // The Azure ASN. + AzureASN *int32 + + // The list of circuit connections associated with Azure Private Peering for this circuit. + Connections []*ExpressRouteCircuitConnection + + // The ExpressRoute connection. + ExpressRouteConnection *ExpressRouteConnectionID + + // The GatewayManager Etag. + GatewayManagerEtag *string + + // The IPv6 peering configuration. + IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig + + // The Microsoft peering configuration. + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig + + // The peer ASN. + PeerASN *int64 + + // The peering type. + PeeringType *ExpressRoutePeeringType + + // The primary port. + PrimaryAzurePort *string + + // The primary address prefix. + PrimaryPeerAddressPrefix *string + + // The reference to the RouteFilter resource. + RouteFilter *SubResource + + // The secondary port. + SecondaryAzurePort *string + + // The secondary address prefix. + SecondaryPeerAddressPrefix *string + + // The shared key. + SharedKey *string + + // The peering state. + State *ExpressRoutePeeringState + + // The peering stats of express route circuit. + Stats *ExpressRouteCircuitStats + + // The VLAN ID. + VlanID *int32 + + // READ-ONLY; Who was the last to modify the peering. + LastModifiedBy *string + + // READ-ONLY; The list of peered circuit connections associated with Azure Private Peering for this circuit. + PeeredConnections []*PeerExpressRouteCircuitConnection + + // READ-ONLY; The provisioning state of the express route circuit peering resource. + ProvisioningState *ProvisioningState +} + +// ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete +// method. +type ExpressRouteCircuitPeeringsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.Get +// method. +type ExpressRouteCircuitPeeringsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.NewListPager +// method. +type ExpressRouteCircuitPeeringsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitPropertiesFormat - Properties of ExpressRouteCircuit. +type ExpressRouteCircuitPropertiesFormat struct { + // Allow classic operations. + AllowClassicOperations *bool + + // The authorizationKey. + AuthorizationKey *string + + // The list of authorizations. + Authorizations []*ExpressRouteCircuitAuthorization + + // The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + BandwidthInGbps *float32 + + // The CircuitProvisioningState state of the resource. + CircuitProvisioningState *string + + // The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + ExpressRoutePort *SubResource + + // The GatewayManager Etag. + GatewayManagerEtag *string + + // Flag denoting global reach status. + GlobalReachEnabled *bool + + // The list of peerings. + Peerings []*ExpressRouteCircuitPeering + + // The ServiceKey. + ServiceKey *string + + // The ServiceProviderNotes. + ServiceProviderNotes *string + + // The ServiceProviderProperties. + ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties + + // The ServiceProviderProvisioningState state of the resource. + ServiceProviderProvisioningState *ServiceProviderProvisioningState + + // READ-ONLY; The authorization status of the Circuit. + AuthorizationStatus *string + + // READ-ONLY; The provisioning state of the express route circuit resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + Stag *int32 +} + +// ExpressRouteCircuitReference - Reference to an express route circuit. +type ExpressRouteCircuitReference struct { + // Corresponding Express Route Circuit Id. + ID *string +} + +// ExpressRouteCircuitRoutesTable - The routes table associated with the ExpressRouteCircuit. +type ExpressRouteCircuitRoutesTable struct { + // Local preference value as set with the set local-preference route-map configuration command. + LocPrf *string + + // IP address of a network entity. + Network *string + + // NextHop address. + NextHop *string + + // Autonomous system paths to the destination network. + Path *string + + // Route Weight. + Weight *int32 +} + +// ExpressRouteCircuitRoutesTableSummary - The routes table associated with the ExpressRouteCircuit. +type ExpressRouteCircuitRoutesTableSummary struct { + // Autonomous system number. + As *int32 + + // IP address of the neighbor. + Neighbor *string + + // Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + StatePfxRcd *string + + // The length of time that the BGP session has been in the Established state, or the current status if not in the Established + // state. + UpDown *string + + // BGP version number spoken to the neighbor. + V *int32 +} + +// ExpressRouteCircuitSKU - Contains SKU in an ExpressRouteCircuit. +type ExpressRouteCircuitSKU struct { + // The family of the SKU. + Family *ExpressRouteCircuitSKUFamily + + // The name of the SKU. + Name *string + + // The tier of the SKU. + Tier *ExpressRouteCircuitSKUTier +} + +// ExpressRouteCircuitServiceProviderProperties - Contains ServiceProviderProperties in an ExpressRouteCircuit. +type ExpressRouteCircuitServiceProviderProperties struct { + // The BandwidthInMbps. + BandwidthInMbps *int32 + + // The peering location. + PeeringLocation *string + + // The serviceProviderName. + ServiceProviderName *string +} + +// ExpressRouteCircuitStats - Contains stats associated with the peering. +type ExpressRouteCircuitStats struct { + // The Primary BytesIn of the peering. + PrimarybytesIn *int64 + + // The primary BytesOut of the peering. + PrimarybytesOut *int64 + + // The secondary BytesIn of the peering. + SecondarybytesIn *int64 + + // The secondary BytesOut of the peering. + SecondarybytesOut *int64 +} + +// ExpressRouteCircuitsArpTableListResult - Response for ListArpTable associated with the Express Route Circuits API. +type ExpressRouteCircuitsArpTableListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of the ARP tables. + Value []*ExpressRouteCircuitArpTable +} + +// ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCircuitsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete +// method. +type ExpressRouteCircuitsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable +// method. +type ExpressRouteCircuitsClientBeginListArpTableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable +// method. +type ExpressRouteCircuitsClientBeginListRoutesTableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary +// method. +type ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get method. +type ExpressRouteCircuitsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsClientGetPeeringStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetPeeringStats +// method. +type ExpressRouteCircuitsClientGetPeeringStatsOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats +// method. +type ExpressRouteCircuitsClientGetStatsOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager +// method. +type ExpressRouteCircuitsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager +// method. +type ExpressRouteCircuitsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCircuitsClient.UpdateTags +// method. +type ExpressRouteCircuitsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCircuitsRoutesTableListResult - Response for ListRoutesTable associated with the Express Route Circuits API. +type ExpressRouteCircuitsRoutesTableListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The list of routes table. + Value []*ExpressRouteCircuitRoutesTable +} + +// ExpressRouteCircuitsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route Circuits +// API. +type ExpressRouteCircuitsRoutesTableSummaryListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of the routes table. + Value []*ExpressRouteCircuitRoutesTableSummary +} + +// ExpressRouteConnection resource. +type ExpressRouteConnection struct { + // REQUIRED; The name of the resource. + Name *string + + // Resource ID. + ID *string + + // Properties of the express route connection. + Properties *ExpressRouteConnectionProperties +} + +// ExpressRouteConnectionID - The ID of the ExpressRouteConnection. +type ExpressRouteConnectionID struct { + // READ-ONLY; The ID of the ExpressRouteConnection. + ID *string +} + +// ExpressRouteConnectionList - ExpressRouteConnection list. +type ExpressRouteConnectionList struct { + // The list of ExpressRoute connections. + Value []*ExpressRouteConnection +} + +// ExpressRouteConnectionProperties - Properties of the ExpressRouteConnection subresource. +type ExpressRouteConnectionProperties struct { + // REQUIRED; The ExpressRoute circuit peering. + ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID + + // Authorization key to establish the connection. + AuthorizationKey *string + + // Enable internet security. + EnableInternetSecurity *bool + + // Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be + // enabled. + EnablePrivateLinkFastPath *bool + + // Enable FastPath to vWan Firewall hub. + ExpressRouteGatewayBypass *bool + + // The Routing Configuration indicating the associated and propagated route tables on this connection. + RoutingConfiguration *RoutingConfiguration + + // The routing weight associated to the connection. + RoutingWeight *int32 + + // READ-ONLY; The provisioning state of the express route connection resource. + ProvisioningState *ProvisioningState +} + +// ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate +// method. +type ExpressRouteConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete +// method. +type ExpressRouteConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteConnectionsClientGetOptions contains the optional parameters for the ExpressRouteConnectionsClient.Get method. +type ExpressRouteConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List method. +type ExpressRouteConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnection resource. +type ExpressRouteCrossConnection struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the express route cross connection. + Properties *ExpressRouteCrossConnectionProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRouteCrossConnectionListResult - Response for ListExpressRouteCrossConnection API service call. +type ExpressRouteCrossConnectionListResult struct { + // A list of ExpressRouteCrossConnection resources. + Value []*ExpressRouteCrossConnection + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ExpressRouteCrossConnectionPeering - Peering in an ExpressRoute Cross Connection resource. +type ExpressRouteCrossConnectionPeering struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the express route cross connection peering. + Properties *ExpressRouteCrossConnectionPeeringProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// ExpressRouteCrossConnectionPeeringList - Response for ListPeering API service call retrieves all peerings that belong to +// an ExpressRouteCrossConnection. +type ExpressRouteCrossConnectionPeeringList struct { + // The peerings in an express route cross connection. + Value []*ExpressRouteCrossConnectionPeering + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ExpressRouteCrossConnectionPeeringProperties - Properties of express route cross connection peering. +type ExpressRouteCrossConnectionPeeringProperties struct { + // The GatewayManager Etag. + GatewayManagerEtag *string + + // The IPv6 peering configuration. + IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig + + // The Microsoft peering configuration. + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig + + // The peer ASN. + PeerASN *int64 + + // The peering type. + PeeringType *ExpressRoutePeeringType + + // The primary address prefix. + PrimaryPeerAddressPrefix *string + + // The secondary address prefix. + SecondaryPeerAddressPrefix *string + + // The shared key. + SharedKey *string + + // The peering state. + State *ExpressRoutePeeringState + + // The VLAN ID. + VlanID *int32 + + // READ-ONLY; The Azure ASN. + AzureASN *int32 + + // READ-ONLY; Who was the last to modify the peering. + LastModifiedBy *string + + // READ-ONLY; The primary port. + PrimaryAzurePort *string + + // READ-ONLY; The provisioning state of the express route cross connection peering resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The secondary port. + SecondaryAzurePort *string +} + +// ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete +// method. +type ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionPeeringsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.Get +// method. +type ExpressRouteCrossConnectionPeeringsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager +// method. +type ExpressRouteCrossConnectionPeeringsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionProperties - Properties of ExpressRouteCrossConnection. +type ExpressRouteCrossConnectionProperties struct { + // The ExpressRouteCircuit. + ExpressRouteCircuit *ExpressRouteCircuitReference + + // The list of peerings. + Peerings []*ExpressRouteCrossConnectionPeering + + // Additional read only notes set by the connectivity provider. + ServiceProviderNotes *string + + // The provisioning state of the circuit in the connectivity provider system. + ServiceProviderProvisioningState *ServiceProviderProvisioningState + + // READ-ONLY; The circuit bandwidth In Mbps. + BandwidthInMbps *int32 + + // READ-ONLY; The peering location of the ExpressRoute circuit. + PeeringLocation *string + + // READ-ONLY; The name of the primary port. + PrimaryAzurePort *string + + // READ-ONLY; The provisioning state of the express route cross connection resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The identifier of the circuit traffic. + STag *int32 + + // READ-ONLY; The name of the secondary port. + SecondaryAzurePort *string +} + +// ExpressRouteCrossConnectionRoutesTableSummary - The routes table associated with the ExpressRouteCircuit. +type ExpressRouteCrossConnectionRoutesTableSummary struct { + // Autonomous system number. + Asn *int32 + + // IP address of Neighbor router. + Neighbor *string + + // Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. + StateOrPrefixesReceived *string + + // The length of time that the BGP session has been in the Established state, or the current status if not in the Established + // state. + UpDown *string +} + +// ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate +// method. +type ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable +// method. +type ExpressRouteCrossConnectionsClientBeginListArpTableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable +// method. +type ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary +// method. +type ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get +// method. +type ExpressRouteCrossConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager +// method. +type ExpressRouteCrossConnectionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager +// method. +type ExpressRouteCrossConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionsClientUpdateTagsOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.UpdateTags +// method. +type ExpressRouteCrossConnectionsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteCrossConnectionsRoutesTableSummaryListResult - Response for ListRoutesTable associated with the Express Route +// Cross Connections. +type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { + // A list of the routes table. + Value []*ExpressRouteCrossConnectionRoutesTableSummary + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ExpressRouteGateway - ExpressRoute gateway resource. +type ExpressRouteGateway struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the express route gateway. + Properties *ExpressRouteGatewayProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRouteGatewayList - List of ExpressRoute gateways. +type ExpressRouteGatewayList struct { + // List of ExpressRoute gateways. + Value []*ExpressRouteGateway +} + +// ExpressRouteGatewayProperties - ExpressRoute gateway resource properties. +type ExpressRouteGatewayProperties struct { + // REQUIRED; The Virtual Hub where the ExpressRoute gateway is or will be deployed. + VirtualHub *VirtualHubID + + // Configures this gateway to accept traffic from non Virtual WAN networks. + AllowNonVirtualWanTraffic *bool + + // Configuration for auto scaling. + AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration + + // List of ExpressRoute connections to the ExpressRoute gateway. + ExpressRouteConnections []*ExpressRouteConnection + + // READ-ONLY; The provisioning state of the express route gateway resource. + ProvisioningState *ProvisioningState +} + +// ExpressRouteGatewayPropertiesAutoScaleConfiguration - Configuration for auto scaling. +type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { + // Minimum and maximum number of scale units to deploy. + Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds +} + +// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds - Minimum and maximum number of scale units to deploy. +type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { + // Maximum number of scale units deployed for ExpressRoute gateway. + Max *int32 + + // Minimum number of scale units deployed for ExpressRoute gateway. + Min *int32 +} + +// ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate +// method. +type ExpressRouteGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete +// method. +type ExpressRouteGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags +// method. +type ExpressRouteGatewaysClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get method. +type ExpressRouteGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup +// method. +type ExpressRouteGatewaysClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription +// method. +type ExpressRouteGatewaysClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteLink child resource definition. +type ExpressRouteLink struct { + // Resource ID. + ID *string + + // Name of child port resource that is unique among child port resources of the parent. + Name *string + + // ExpressRouteLink properties. + Properties *ExpressRouteLinkPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// ExpressRouteLinkListResult - Response for ListExpressRouteLinks API service call. +type ExpressRouteLinkListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The list of ExpressRouteLink sub-resources. + Value []*ExpressRouteLink +} + +// ExpressRouteLinkMacSecConfig - ExpressRouteLink Mac Security Configuration. +type ExpressRouteLinkMacSecConfig struct { + // Keyvault Secret Identifier URL containing Mac security CAK key. + CakSecretIdentifier *string + + // Mac security cipher. + Cipher *ExpressRouteLinkMacSecCipher + + // Keyvault Secret Identifier URL containing Mac security CKN key. + CknSecretIdentifier *string + + // Sci mode enabled/disabled. + SciState *ExpressRouteLinkMacSecSciState +} + +// ExpressRouteLinkPropertiesFormat - Properties specific to ExpressRouteLink resources. +type ExpressRouteLinkPropertiesFormat struct { + // Administrative state of the physical port. + AdminState *ExpressRouteLinkAdminState + + // MacSec configuration. + MacSecConfig *ExpressRouteLinkMacSecConfig + + // READ-ONLY; Cololocation for ExpressRoute Hybrid Direct. + ColoLocation *string + + // READ-ONLY; Physical fiber port type. + ConnectorType *ExpressRouteLinkConnectorType + + // READ-ONLY; Name of Azure router interface. + InterfaceName *string + + // READ-ONLY; Mapping between physical port to patch panel port. + PatchPanelID *string + + // READ-ONLY; The provisioning state of the express route link resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Mapping of physical patch panel to rack. + RackID *string + + // READ-ONLY; Name of Azure router associated with physical port. + RouterName *string +} + +// ExpressRouteLinksClientGetOptions contains the optional parameters for the ExpressRouteLinksClient.Get method. +type ExpressRouteLinksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.NewListPager method. +type ExpressRouteLinksClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePort resource definition. +type ExpressRoutePort struct { + // Resource ID. + ID *string + + // The identity of ExpressRoutePort, if configured. + Identity *ManagedServiceIdentity + + // Resource location. + Location *string + + // ExpressRoutePort properties. + Properties *ExpressRoutePortPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRoutePortAuthorization - ExpressRoutePort Authorization resource definition. +type ExpressRoutePortAuthorization struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // ExpressRoutePort properties. + Properties *ExpressRoutePortAuthorizationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ExpressRoutePortAuthorizationListResult - Response for ListExpressRoutePortAuthorizations API service call. +type ExpressRoutePortAuthorizationListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The authorizations in an ExpressRoute Port. + Value []*ExpressRoutePortAuthorization +} + +// ExpressRoutePortAuthorizationPropertiesFormat - Properties of ExpressRoutePort Authorization. +type ExpressRoutePortAuthorizationPropertiesFormat struct { + // READ-ONLY; The authorization key. + AuthorizationKey *string + + // READ-ONLY; The authorization use status. + AuthorizationUseStatus *ExpressRoutePortAuthorizationUseStatus + + // READ-ONLY; The reference to the ExpressRoute circuit resource using the authorization. + CircuitResourceURI *string + + // READ-ONLY; The provisioning state of the authorization resource. + ProvisioningState *ProvisioningState +} + +// ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate +// method. +type ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete +// method. +type ExpressRoutePortAuthorizationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRoutePortAuthorizationsClientGetOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.Get +// method. +type ExpressRoutePortAuthorizationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.NewListPager +// method. +type ExpressRoutePortAuthorizationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortListResult - Response for ListExpressRoutePorts API service call. +type ExpressRoutePortListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of ExpressRoutePort resources. + Value []*ExpressRoutePort +} + +// ExpressRoutePortPropertiesFormat - Properties specific to ExpressRoutePort resources. +type ExpressRoutePortPropertiesFormat struct { + // Bandwidth of procured ports in Gbps. + BandwidthInGbps *int32 + + // The billing type of the ExpressRoutePort resource. + BillingType *ExpressRoutePortsBillingType + + // Encapsulation method on physical ports. + Encapsulation *ExpressRoutePortsEncapsulation + + // The set of physical links of the ExpressRoutePort resource. + Links []*ExpressRouteLink + + // The name of the peering location that the ExpressRoutePort is mapped to physically. + PeeringLocation *string + + // READ-ONLY; Date of the physical port allocation to be used in Letter of Authorization. + AllocationDate *string + + // READ-ONLY; Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. + Circuits []*SubResource + + // READ-ONLY; Ether type of the physical port. + EtherType *string + + // READ-ONLY; Maximum transmission unit of the physical port pair(s). + Mtu *string + + // READ-ONLY; Aggregate Gbps of associated circuit bandwidths. + ProvisionedBandwidthInGbps *float32 + + // READ-ONLY; The provisioning state of the express route port resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the express route port resource. + ResourceGUID *string +} + +// ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate +// method. +type ExpressRoutePortsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete +// method. +type ExpressRoutePortsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExpressRoutePortsClientGenerateLOAOptions contains the optional parameters for the ExpressRoutePortsClient.GenerateLOA +// method. +type ExpressRoutePortsClientGenerateLOAOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. +type ExpressRoutePortsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager +// method. +type ExpressRoutePortsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager method. +type ExpressRoutePortsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsClientUpdateTagsOptions contains the optional parameters for the ExpressRoutePortsClient.UpdateTags method. +type ExpressRoutePortsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsLocation - Definition of the ExpressRoutePorts peering location resource. +type ExpressRoutePortsLocation struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // ExpressRoutePort peering location properties. + Properties *ExpressRoutePortsLocationPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRoutePortsLocationBandwidths - Real-time inventory of available ExpressRoute port bandwidths. +type ExpressRoutePortsLocationBandwidths struct { + // READ-ONLY; Bandwidth descriptive name. + OfferName *string + + // READ-ONLY; Bandwidth value in Gbps. + ValueInGbps *int32 +} + +// ExpressRoutePortsLocationListResult - Response for ListExpressRoutePortsLocations API service call. +type ExpressRoutePortsLocationListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The list of all ExpressRoutePort peering locations. + Value []*ExpressRoutePortsLocation +} + +// ExpressRoutePortsLocationPropertiesFormat - Properties specific to ExpressRoutePorts peering location resources. +type ExpressRoutePortsLocationPropertiesFormat struct { + // The inventory of available ExpressRoutePort bandwidths. + AvailableBandwidths []*ExpressRoutePortsLocationBandwidths + + // READ-ONLY; Address of peering location. + Address *string + + // READ-ONLY; Contact details of peering locations. + Contact *string + + // READ-ONLY; The provisioning state of the express route port location resource. + ProvisioningState *ProvisioningState +} + +// ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get +// method. +type ExpressRoutePortsLocationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager +// method. +type ExpressRoutePortsLocationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExpressRouteProviderPort resource. +type ExpressRouteProviderPort struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the express route Service Provider Port. + Properties *ExpressRouteProviderPortProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRouteProviderPortListResult - Response for ListExpressRouteProviderPort API service call. +type ExpressRouteProviderPortListResult struct { + // A list of ExpressRouteProviderPort resources. + Value []*ExpressRouteProviderPort + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ExpressRouteProviderPortProperties - Properties of ExpressRouteProviderPort. +type ExpressRouteProviderPortProperties struct { + // Overprovisioning factor for the port pair. + OverprovisionFactor *int32 + + // The peering location of the port pair. + PeeringLocation *string + + // Bandwidth of the port in Mbps + PortBandwidthInMbps *int32 + + // Remaining Bandwidth of the port in Mbps + RemainingBandwidthInMbps *int32 + + // Used Bandwidth of the port in Mbps + UsedBandwidthInMbps *int32 + + // READ-ONLY; The name of the port pair. + PortPairDescriptor *string + + // READ-ONLY; The name of the primary port. + PrimaryAzurePort *string + + // READ-ONLY; The name of the secondary port. + SecondaryAzurePort *string +} + +// ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List +// method. +type ExpressRouteProviderPortsLocationClientListOptions struct { + // The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + Filter *string +} + +// ExpressRouteServiceProvider - A ExpressRouteResourceProvider object. +type ExpressRouteServiceProvider struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the express route service provider. + Properties *ExpressRouteServiceProviderPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ExpressRouteServiceProviderBandwidthsOffered - Contains bandwidths offered in ExpressRouteServiceProvider resources. +type ExpressRouteServiceProviderBandwidthsOffered struct { + // The OfferName. + OfferName *string + + // The ValueInMbps. + ValueInMbps *int32 +} + +// ExpressRouteServiceProviderListResult - Response for the ListExpressRouteServiceProvider API service call. +type ExpressRouteServiceProviderListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of ExpressRouteResourceProvider resources. + Value []*ExpressRouteServiceProvider +} + +// ExpressRouteServiceProviderPropertiesFormat - Properties of ExpressRouteServiceProvider. +type ExpressRouteServiceProviderPropertiesFormat struct { + // A list of bandwidths offered. + BandwidthsOffered []*ExpressRouteServiceProviderBandwidthsOffered + + // A list of peering locations. + PeeringLocations []*string + + // READ-ONLY; The provisioning state of the express route service provider resource. + ProvisioningState *ProvisioningState +} + +// ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager +// method. +type ExpressRouteServiceProvidersClientListOptions struct { + // placeholder for future optional parameters +} + +// ExtendedLocation complex type. +type ExtendedLocation struct { + // The name of the extended location. + Name *string + + // The type of the extended location. + Type *ExtendedLocationTypes +} + +// FilterItems - Will contain the filter name and values to operate on +type FilterItems struct { + // The name of the field we would like to filter + Field *string + + // List of values to filter the current field by + Values []*string +} + +// FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate +// method. +type FirewallPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete method. +type FirewallPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. +type FirewallPoliciesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager method. +type FirewallPoliciesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager method. +type FirewallPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// FirewallPoliciesClientUpdateTagsOptions contains the optional parameters for the FirewallPoliciesClient.UpdateTags method. +type FirewallPoliciesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicy Resource. +type FirewallPolicy struct { + // Resource ID. + ID *string + + // The identity of the firewall policy. + Identity *ManagedServiceIdentity + + // Resource location. + Location *string + + // Properties of the firewall policy. + Properties *FirewallPolicyPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// FirewallPolicyCertificateAuthority - Trusted Root certificates properties for tls. +type FirewallPolicyCertificateAuthority struct { + // Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + KeyVaultSecretID *string + + // Name of the CA certificate. + Name *string +} + +// FirewallPolicyFilterRuleCollection - Firewall Policy Filter Rule Collection. +type FirewallPolicyFilterRuleCollection struct { + // REQUIRED; The type of the rule collection. + RuleCollectionType *FirewallPolicyRuleCollectionType + + // The action type of a Filter rule collection. + Action *FirewallPolicyFilterRuleCollectionAction + + // The name of the rule collection. + Name *string + + // Priority of the Firewall Policy Rule Collection resource. + Priority *int32 + + // List of rules included in a rule collection. + Rules []FirewallPolicyRuleClassification +} + +// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyFilterRuleCollection. +func (f *FirewallPolicyFilterRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { + return &FirewallPolicyRuleCollection{ + RuleCollectionType: f.RuleCollectionType, + Name: f.Name, + Priority: f.Priority, + } +} + +// FirewallPolicyFilterRuleCollectionAction - Properties of the FirewallPolicyFilterRuleCollectionAction. +type FirewallPolicyFilterRuleCollectionAction struct { + // The type of action. + Type *FirewallPolicyFilterRuleCollectionActionType +} + +// FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List +// method. +type FirewallPolicyIdpsSignaturesClientListOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List +// method. +type FirewallPolicyIdpsSignaturesFilterValuesClientListOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get +// method. +type FirewallPolicyIdpsSignaturesOverridesClientGetOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List +// method. +type FirewallPolicyIdpsSignaturesOverridesClientListOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyIdpsSignaturesOverridesClientPatchOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Patch +// method. +type FirewallPolicyIdpsSignaturesOverridesClientPatchOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyIdpsSignaturesOverridesClientPutOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Put +// method. +type FirewallPolicyIdpsSignaturesOverridesClientPutOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyInsights - Firewall Policy Insights. +type FirewallPolicyInsights struct { + // A flag to indicate if the insights are enabled on the policy. + IsEnabled *bool + + // Workspaces needed to configure the Firewall Policy Insights. + LogAnalyticsResources *FirewallPolicyLogAnalyticsResources + + // Number of days the insights should be enabled on the policy. + RetentionDays *int32 +} + +// FirewallPolicyIntrusionDetection - Configuration for intrusion detection mode and rules. +type FirewallPolicyIntrusionDetection struct { + // Intrusion detection configuration properties. + Configuration *FirewallPolicyIntrusionDetectionConfiguration + + // Intrusion detection general state. + Mode *FirewallPolicyIntrusionDetectionStateType +} + +// FirewallPolicyIntrusionDetectionBypassTrafficSpecifications - Intrusion detection bypass traffic specification. +type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications struct { + // Description of the bypass traffic rule. + Description *string + + // List of destination IP addresses or ranges for this rule. + DestinationAddresses []*string + + // List of destination IpGroups for this rule. + DestinationIPGroups []*string + + // List of destination ports or ranges. + DestinationPorts []*string + + // Name of the bypass traffic rule. + Name *string + + // The rule bypass protocol. + Protocol *FirewallPolicyIntrusionDetectionProtocol + + // List of source IP addresses or ranges for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string +} + +// FirewallPolicyIntrusionDetectionConfiguration - The operation for configuring intrusion detection. +type FirewallPolicyIntrusionDetectionConfiguration struct { + // List of rules for traffic to bypass. + BypassTrafficSettings []*FirewallPolicyIntrusionDetectionBypassTrafficSpecifications + + // IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only + // ranges defined by IANA RFC 1918 are considered private IP addresses. To modify + // default ranges, specify your Private IP address ranges with this property + PrivateRanges []*string + + // List of specific signatures states. + SignatureOverrides []*FirewallPolicyIntrusionDetectionSignatureSpecification +} + +// FirewallPolicyIntrusionDetectionSignatureSpecification - Intrusion detection signatures specification states. +type FirewallPolicyIntrusionDetectionSignatureSpecification struct { + // Signature id. + ID *string + + // The signature state. + Mode *FirewallPolicyIntrusionDetectionStateType +} + +// FirewallPolicyListResult - Response for ListFirewallPolicies API service call. +type FirewallPolicyListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Firewall Policies in a resource group. + Value []*FirewallPolicy +} + +// FirewallPolicyLogAnalyticsResources - Log Analytics Resources for Firewall Policy Insights. +type FirewallPolicyLogAnalyticsResources struct { + // The default workspace Id for Firewall Policy Insights. + DefaultWorkspaceID *SubResource + + // List of workspaces for Firewall Policy Insights. + Workspaces []*FirewallPolicyLogAnalyticsWorkspace +} + +// FirewallPolicyLogAnalyticsWorkspace - Log Analytics Workspace for Firewall Policy Insights. +type FirewallPolicyLogAnalyticsWorkspace struct { + // Region to configure the Workspace. + Region *string + + // The workspace Id for Firewall Policy Insights. + WorkspaceID *SubResource +} + +// FirewallPolicyNatRuleCollection - Firewall Policy NAT Rule Collection. +type FirewallPolicyNatRuleCollection struct { + // REQUIRED; The type of the rule collection. + RuleCollectionType *FirewallPolicyRuleCollectionType + + // The action type of a Nat rule collection. + Action *FirewallPolicyNatRuleCollectionAction + + // The name of the rule collection. + Name *string + + // Priority of the Firewall Policy Rule Collection resource. + Priority *int32 + + // List of rules included in a rule collection. + Rules []FirewallPolicyRuleClassification +} + +// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyNatRuleCollection. +func (f *FirewallPolicyNatRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { + return &FirewallPolicyRuleCollection{ + RuleCollectionType: f.RuleCollectionType, + Name: f.Name, + Priority: f.Priority, + } +} + +// FirewallPolicyNatRuleCollectionAction - Properties of the FirewallPolicyNatRuleCollectionAction. +type FirewallPolicyNatRuleCollectionAction struct { + // The type of action. + Type *FirewallPolicyNatRuleCollectionActionType +} + +// FirewallPolicyPropertiesFormat - Firewall Policy definition. +type FirewallPolicyPropertiesFormat struct { + // The parent firewall policy from which rules are inherited. + BasePolicy *SubResource + + // DNS Proxy Settings definition. + DNSSettings *DNSSettings + + // Explicit Proxy Settings definition. + ExplicitProxySettings *ExplicitProxySettings + + // Insights on Firewall Policy. + Insights *FirewallPolicyInsights + + // The configuration for Intrusion detection. + IntrusionDetection *FirewallPolicyIntrusionDetection + + // The Firewall Policy SKU. + SKU *FirewallPolicySKU + + // SQL Settings definition. + SQL *FirewallPolicySQL + + // The private IP addresses/IP ranges to which traffic will not be SNAT. + Snat *FirewallPolicySNAT + + // The operation mode for Threat Intelligence. + ThreatIntelMode *AzureFirewallThreatIntelMode + + // ThreatIntel Whitelist for Firewall Policy. + ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist + + // TLS Configuration definition. + TransportSecurity *FirewallPolicyTransportSecurity + + // READ-ONLY; List of references to Child Firewall Policies. + ChildPolicies []*SubResource + + // READ-ONLY; List of references to Azure Firewalls that this Firewall Policy is associated with. + Firewalls []*SubResource + + // READ-ONLY; The provisioning state of the firewall policy resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of references to FirewallPolicyRuleCollectionGroups. + RuleCollectionGroups []*SubResource +} + +// FirewallPolicyRuleClassification provides polymorphic access to related types. +// Call the interface's GetFirewallPolicyRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ApplicationRule, *FirewallPolicyRule, *NatRule, *Rule +type FirewallPolicyRuleClassification interface { + // GetFirewallPolicyRule returns the FirewallPolicyRule content of the underlying type. + GetFirewallPolicyRule() *FirewallPolicyRule +} + +// FirewallPolicyRule - Properties of a rule. +type FirewallPolicyRule struct { + // REQUIRED; Rule Type. + RuleType *FirewallPolicyRuleType + + // Description of the rule. + Description *string + + // Name of the rule. + Name *string +} + +// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type FirewallPolicyRule. +func (f *FirewallPolicyRule) GetFirewallPolicyRule() *FirewallPolicyRule { return f } + +// FirewallPolicyRuleApplicationProtocol - Properties of the application rule protocol. +type FirewallPolicyRuleApplicationProtocol struct { + // Port number for the protocol, cannot be greater than 64000. + Port *int32 + + // Protocol type. + ProtocolType *FirewallPolicyRuleApplicationProtocolType +} + +// FirewallPolicyRuleCollectionClassification provides polymorphic access to related types. +// Call the interface's GetFirewallPolicyRuleCollection() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *FirewallPolicyFilterRuleCollection, *FirewallPolicyNatRuleCollection, *FirewallPolicyRuleCollection +type FirewallPolicyRuleCollectionClassification interface { + // GetFirewallPolicyRuleCollection returns the FirewallPolicyRuleCollection content of the underlying type. + GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection +} + +// FirewallPolicyRuleCollection - Properties of the rule collection. +type FirewallPolicyRuleCollection struct { + // REQUIRED; The type of the rule collection. + RuleCollectionType *FirewallPolicyRuleCollectionType + + // The name of the rule collection. + Name *string + + // Priority of the Firewall Policy Rule Collection resource. + Priority *int32 +} + +// GetFirewallPolicyRuleCollection implements the FirewallPolicyRuleCollectionClassification interface for type FirewallPolicyRuleCollection. +func (f *FirewallPolicyRuleCollection) GetFirewallPolicyRuleCollection() *FirewallPolicyRuleCollection { + return f +} + +// FirewallPolicyRuleCollectionGroup - Rule Collection Group resource. +type FirewallPolicyRuleCollectionGroup struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // The properties of the firewall policy rule collection group. + Properties *FirewallPolicyRuleCollectionGroupProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Rule Group type. + Type *string +} + +// FirewallPolicyRuleCollectionGroupListResult - Response for ListFirewallPolicyRuleCollectionGroups API service call. +type FirewallPolicyRuleCollectionGroupListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + Value []*FirewallPolicyRuleCollectionGroup +} + +// FirewallPolicyRuleCollectionGroupProperties - Properties of the rule collection group. +type FirewallPolicyRuleCollectionGroupProperties struct { + // Priority of the Firewall Policy Rule Collection Group resource. + Priority *int32 + + // Group of Firewall Policy rule collections. + RuleCollections []FirewallPolicyRuleCollectionClassification + + // READ-ONLY; The provisioning state of the firewall policy rule collection group resource. + ProvisioningState *ProvisioningState +} + +// FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate +// method. +type FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete +// method. +type FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallPolicyRuleCollectionGroupsClientGetOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.Get +// method. +type FirewallPolicyRuleCollectionGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.NewListPager +// method. +type FirewallPolicyRuleCollectionGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// FirewallPolicySKU - SKU of Firewall policy. +type FirewallPolicySKU struct { + // Tier of Firewall Policy. + Tier *FirewallPolicySKUTier +} + +// FirewallPolicySNAT - The private IP addresses/IP ranges to which traffic will not be SNAT. +type FirewallPolicySNAT struct { + // The operation mode for automatically learning private ranges to not be SNAT + AutoLearnPrivateRanges *AutoLearnPrivateRangesMode + + // List of private IP addresses/IP address ranges to not be SNAT. + PrivateRanges []*string +} + +// FirewallPolicySQL - SQL Settings in Firewall Policy. +type FirewallPolicySQL struct { + // A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port 11000-11999. + AllowSQLRedirect *bool +} + +// FirewallPolicyThreatIntelWhitelist - ThreatIntel Whitelist for Firewall Policy. +type FirewallPolicyThreatIntelWhitelist struct { + // List of FQDNs for the ThreatIntel Whitelist. + Fqdns []*string + + // List of IP addresses for the ThreatIntel Whitelist. + IPAddresses []*string +} + +// FirewallPolicyTransportSecurity - Configuration needed to perform TLS termination & initiation. +type FirewallPolicyTransportSecurity struct { + // The CA used for intermediate CA generation. + CertificateAuthority *FirewallPolicyCertificateAuthority +} + +// FlowLog - A flow log resource. +type FlowLog struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the flow log. + Properties *FlowLogPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// FlowLogFormatParameters - Parameters that define the flow log format. +type FlowLogFormatParameters struct { + // The file type of flow log. + Type *FlowLogFormatType + + // The version (revision) of the flow log. + Version *int32 +} + +// FlowLogInformation - Information on the configuration of flow log and traffic analytics (optional) . +type FlowLogInformation struct { + // REQUIRED; Properties of the flow log. + Properties *FlowLogProperties + + // REQUIRED; The ID of the resource to configure for flow log and traffic analytics (optional) . + TargetResourceID *string + + // Parameters that define the configuration of traffic analytics. + FlowAnalyticsConfiguration *TrafficAnalyticsProperties +} + +// FlowLogListResult - List of flow logs. +type FlowLogListResult struct { + // Information about flow log resource. + Value []*FlowLog + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// FlowLogProperties - Parameters that define the configuration of flow log. +type FlowLogProperties struct { + // REQUIRED; Flag to enable/disable flow logging. + Enabled *bool + + // REQUIRED; ID of the storage account which is used to store the flow log. + StorageID *string + + // Parameters that define the flow log format. + Format *FlowLogFormatParameters + + // Parameters that define the retention policy for flow log. + RetentionPolicy *RetentionPolicyParameters +} + +// FlowLogPropertiesFormat - Parameters that define the configuration of flow log. +type FlowLogPropertiesFormat struct { + // REQUIRED; ID of the storage account which is used to store the flow log. + StorageID *string + + // REQUIRED; ID of network security group to which flow log will be applied. + TargetResourceID *string + + // Flag to enable/disable flow logging. + Enabled *bool + + // Parameters that define the configuration of traffic analytics. + FlowAnalyticsConfiguration *TrafficAnalyticsProperties + + // Parameters that define the flow log format. + Format *FlowLogFormatParameters + + // Parameters that define the retention policy for flow log. + RetentionPolicy *RetentionPolicyParameters + + // READ-ONLY; The provisioning state of the flow log. + ProvisioningState *ProvisioningState + + // READ-ONLY; Guid of network security group to which flow log will be applied. + TargetResourceGUID *string +} + +// FlowLogStatusParameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. +type FlowLogStatusParameters struct { + // REQUIRED; The target resource where getting the flow log and traffic analytics (optional) status. + TargetResourceID *string +} + +// FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate method. +type FlowLogsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. +type FlowLogsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FlowLogsClientGetOptions contains the optional parameters for the FlowLogsClient.Get method. +type FlowLogsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.NewListPager method. +type FlowLogsClientListOptions struct { + // placeholder for future optional parameters +} + +// FlowLogsClientUpdateTagsOptions contains the optional parameters for the FlowLogsClient.UpdateTags method. +type FlowLogsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// FrontendIPConfiguration - Frontend IP address of the load balancer. +type FrontendIPConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name + // can be used to access the resource. + Name *string + + // Properties of the load balancer probe. + Properties *FrontendIPConfigurationPropertiesFormat + + // A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// FrontendIPConfigurationPropertiesFormat - Properties of Frontend IP Configuration of the load balancer. +type FrontendIPConfigurationPropertiesFormat struct { + // The reference to gateway load balancer frontend IP. + GatewayLoadBalancer *SubResource + + // The private IP address of the IP configuration. + PrivateIPAddress *string + + // Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + PrivateIPAddressVersion *IPVersion + + // The Private IP allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // The reference to the Public IP resource. + PublicIPAddress *PublicIPAddress + + // The reference to the Public IP Prefix resource. + PublicIPPrefix *SubResource + + // The reference to the subnet resource. + Subnet *Subnet + + // READ-ONLY; An array of references to inbound pools that use this frontend IP. + InboundNatPools []*SubResource + + // READ-ONLY; An array of references to inbound rules that use this frontend IP. + InboundNatRules []*SubResource + + // READ-ONLY; An array of references to load balancing rules that use this frontend IP. + LoadBalancingRules []*SubResource + + // READ-ONLY; An array of references to outbound rules that use this frontend IP. + OutboundRules []*SubResource + + // READ-ONLY; The provisioning state of the frontend IP configuration resource. + ProvisioningState *ProvisioningState +} + +// GatewayCustomBgpIPAddressIPConfiguration - GatewayCustomBgpIpAddressIpConfiguration for a virtual network gateway connection. +type GatewayCustomBgpIPAddressIPConfiguration struct { + // REQUIRED; The custom BgpPeeringAddress which belongs to IpconfigurationId. + CustomBgpIPAddress *string + + // REQUIRED; The IpconfigurationId of ipconfiguration which belongs to gateway. + IPConfigurationID *string +} + +// GatewayLoadBalancerTunnelInterface - Gateway load balancer tunnel interface of a load balancer backend address pool. +type GatewayLoadBalancerTunnelInterface struct { + // Identifier of gateway load balancer tunnel interface. + Identifier *int32 + + // Port of gateway load balancer tunnel interface. + Port *int32 + + // Protocol of gateway load balancer tunnel interface. + Protocol *GatewayLoadBalancerTunnelProtocol + + // Traffic type of gateway load balancer tunnel interface. + Type *GatewayLoadBalancerTunnelInterfaceType +} + +// GatewayRoute - Gateway routing details. +type GatewayRoute struct { + // READ-ONLY; The route's AS path sequence. + AsPath *string + + // READ-ONLY; The gateway's local address. + LocalAddress *string + + // READ-ONLY; The route's network prefix. + Network *string + + // READ-ONLY; The route's next hop. + NextHop *string + + // READ-ONLY; The source this route was learned from. + Origin *string + + // READ-ONLY; The peer this route was learned from. + SourcePeer *string + + // READ-ONLY; The route's weight. + Weight *int32 +} + +// GatewayRouteListResult - List of virtual network gateway routes. +type GatewayRouteListResult struct { + // List of gateway routes. + Value []*GatewayRoute +} + +// GenerateExpressRoutePortsLOARequest - The customer name to be printed on a letter of authorization. +type GenerateExpressRoutePortsLOARequest struct { + // REQUIRED; The customer name. + CustomerName *string +} + +// GenerateExpressRoutePortsLOAResult - Response for GenerateExpressRoutePortsLOA API service call. +type GenerateExpressRoutePortsLOAResult struct { + // The content as a base64 encoded string. + EncodedContent *string +} + +// GetInboundRoutesParameters - The parameters specifying the connection resource whose inbound routes are being requested. +type GetInboundRoutesParameters struct { + // The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + // P2SConnection. + ConnectionType *string + + // The connection resource whose inbound routes are being requested. + ResourceURI *string +} + +// GetOutboundRoutesParameters - The parameters specifying the connection resource whose outbound routes are being requested. +type GetOutboundRoutesParameters struct { + // The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + // P2SConnection. + ConnectionType *string + + // The connection resource whose outbound routes are being requested. + ResourceURI *string +} + +// GetVPNSitesConfigurationRequest - List of Vpn-Sites. +type GetVPNSitesConfigurationRequest struct { + // REQUIRED; The sas-url to download the configurations for vpn-sites. + OutputBlobSasURL *string + + // List of resource-ids of the vpn-sites for which config is to be downloaded. + VPNSites []*string +} + +// Group - The network group resource +type Group struct { + // The Network Group properties + Properties *GroupProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// GroupListResult - Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get the next +// set of results. +type GroupListResult struct { + // Gets the URL to get the next set of results. + NextLink *string + + // Gets a page of NetworkGroup + Value []*Group +} + +// GroupProperties - Properties of network group +type GroupProperties struct { + // A description of the network group. + Description *string + + // READ-ONLY; The provisioning state of the scope assignment resource. + ProvisioningState *ProvisioningState +} + +// GroupsClientBeginDeleteOptions contains the optional parameters for the GroupsClient.BeginDelete method. +type GroupsClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GroupsClientCreateOrUpdateOptions contains the optional parameters for the GroupsClient.CreateOrUpdate method. +type GroupsClientCreateOrUpdateOptions struct { + // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + // to prevent accidentally overwriting concurrent changes. + IfMatch *string +} + +// GroupsClientGetOptions contains the optional parameters for the GroupsClient.Get method. +type GroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. +type GroupsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// HTTPConfiguration - HTTP configuration of the connectivity check. +type HTTPConfiguration struct { + // List of HTTP headers. + Headers []*HTTPHeader + + // HTTP method. + Method *HTTPMethod + + // Valid status codes. + ValidStatusCodes []*int32 +} + +// HTTPHeader - The HTTP header. +type HTTPHeader struct { + // The name in HTTP header. + Name *string + + // The value in HTTP header. + Value *string +} + +// HopLink - Hop link. +type HopLink struct { + // Hop link properties. + Properties *HopLinkProperties + + // READ-ONLY; Provides additional context on links. + Context map[string]*string + + // READ-ONLY; List of issues. + Issues []*ConnectivityIssue + + // READ-ONLY; Link type. + LinkType *string + + // READ-ONLY; The ID of the next hop. + NextHopID *string + + // READ-ONLY; Resource ID. + ResourceID *string +} + +// HopLinkProperties - Hop link properties. +type HopLinkProperties struct { + // READ-ONLY; Average roundtrip time in milliseconds. + RoundTripTimeAvg *int64 + + // READ-ONLY; Maximum roundtrip time in milliseconds. + RoundTripTimeMax *int64 + + // READ-ONLY; Minimum roundtrip time in milliseconds. + RoundTripTimeMin *int64 +} + +// Hub Item. +type Hub struct { + // Resource Id. + ResourceID *string + + // Resource Type. + ResourceType *string +} + +// HubIPAddresses - IP addresses associated with azure firewall. +type HubIPAddresses struct { + // Private IP Address associated with azure firewall. + PrivateIPAddress *string + + // Public IP addresses associated with azure firewall. + PublicIPs *HubPublicIPAddresses +} + +// HubIPConfiguration - IpConfigurations. +type HubIPConfiguration struct { + // Resource ID. + ID *string + + // Name of the Ip Configuration. + Name *string + + // The properties of the Virtual Hub IPConfigurations. + Properties *HubIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Ipconfiguration type. + Type *string +} + +// HubIPConfigurationPropertiesFormat - Properties of IP configuration. +type HubIPConfigurationPropertiesFormat struct { + // The private IP address of the IP configuration. + PrivateIPAddress *string + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // The reference to the public IP resource. + PublicIPAddress *PublicIPAddress + + // The reference to the subnet resource. + Subnet *Subnet + + // READ-ONLY; The provisioning state of the IP configuration resource. + ProvisioningState *ProvisioningState +} + +// HubPublicIPAddresses - Public IP addresses associated with azure firewall. +type HubPublicIPAddresses struct { + // The list of Public IP addresses associated with azure firewall or IP addresses to be retained. + Addresses []*AzureFirewallPublicIPAddress + + // The number of Public IP addresses associated with azure firewall. + Count *int32 +} + +// HubRoute - RouteTable route. +type HubRoute struct { + // REQUIRED; The type of destinations (eg: CIDR, ResourceId, Service). + DestinationType *string + + // REQUIRED; List of all destinations. + Destinations []*string + + // REQUIRED; The name of the Route that is unique within a RouteTable. This name can be used to access this route. + Name *string + + // REQUIRED; NextHop resource ID. + NextHop *string + + // REQUIRED; The type of next hop (eg: ResourceId). + NextHopType *string +} + +// HubRouteTable - RouteTable resource in a virtual hub. +type HubRouteTable struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the RouteTable resource. + Properties *HubRouteTableProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// HubRouteTableProperties - Parameters for RouteTable. +type HubRouteTableProperties struct { + // List of labels associated with this route table. + Labels []*string + + // List of all routes. + Routes []*HubRoute + + // READ-ONLY; List of all connections associated with this route table. + AssociatedConnections []*string + + // READ-ONLY; List of all connections that advertise to this route table. + PropagatingConnections []*string + + // READ-ONLY; The provisioning state of the RouteTable resource. + ProvisioningState *ProvisioningState +} + +// HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate +// method. +type HubRouteTablesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete method. +type HubRouteTablesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// HubRouteTablesClientGetOptions contains the optional parameters for the HubRouteTablesClient.Get method. +type HubRouteTablesClientGetOptions struct { + // placeholder for future optional parameters +} + +// HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.NewListPager method. +type HubRouteTablesClientListOptions struct { + // placeholder for future optional parameters +} + +// HubVirtualNetworkConnection Resource. +type HubVirtualNetworkConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the hub virtual network connection. + Properties *HubVirtualNetworkConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// HubVirtualNetworkConnectionProperties - Parameters for HubVirtualNetworkConnection. +type HubVirtualNetworkConnectionProperties struct { + // Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + AllowHubToRemoteVnetTransit *bool + + // Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + AllowRemoteVnetToUseHubVnetGateways *bool + + // Enable internet security. + EnableInternetSecurity *bool + + // Reference to the remote virtual network. + RemoteVirtualNetwork *SubResource + + // The Routing Configuration indicating the associated and propagated route tables on this connection. + RoutingConfiguration *RoutingConfiguration + + // READ-ONLY; The provisioning state of the hub virtual network connection resource. + ProvisioningState *ProvisioningState +} + +// HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate +// method. +type HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete +// method. +type HubVirtualNetworkConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// HubVirtualNetworkConnectionsClientGetOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.Get +// method. +type HubVirtualNetworkConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.NewListPager +// method. +type HubVirtualNetworkConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// IDPSQueryObject - Will describe the query to run against the IDPS signatures DB +type IDPSQueryObject struct { + // Contain all filters names and values + Filters []*FilterItems + + // Column to sort response by + OrderBy *OrderBy + + // The number of the results to return in each page + ResultsPerPage *int32 + + // Search term in all columns + Search *string + + // The number of records matching the filter to skip + Skip *int32 +} + +// IPAddressAvailabilityResult - Response for CheckIPAddressAvailability API service call. +type IPAddressAvailabilityResult struct { + // Private IP address availability. + Available *bool + + // Contains other available private IP addresses if the asked for address is taken. + AvailableIPAddresses []*string + + // Private IP address platform reserved. + IsPlatformReserved *bool +} + +// IPAllocation - IpAllocation resource. +type IPAllocation struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the IpAllocation. + Properties *IPAllocationPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// IPAllocationListResult - Response for the ListIpAllocations API service call. +type IPAllocationListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of IpAllocation resources. + Value []*IPAllocation +} + +// IPAllocationPropertiesFormat - Properties of the IpAllocation. +type IPAllocationPropertiesFormat struct { + // IpAllocation tags. + AllocationTags map[string]*string + + // The IPAM allocation ID. + IpamAllocationID *string + + // The address prefix for the IpAllocation. + Prefix *string + + // The address prefix length for the IpAllocation. + PrefixLength *int32 + + // The address prefix Type for the IpAllocation. + PrefixType *IPVersion + + // The type for the IpAllocation. + Type *IPAllocationType + + // READ-ONLY; The Subnet that using the prefix of this IpAllocation resource. + Subnet *SubResource + + // READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. + VirtualNetwork *SubResource +} + +// IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate +// method. +type IPAllocationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete method. +type IPAllocationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. +type IPAllocationsClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager +// method. +type IPAllocationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// IPAllocationsClientListOptions contains the optional parameters for the IPAllocationsClient.NewListPager method. +type IPAllocationsClientListOptions struct { + // placeholder for future optional parameters +} + +// IPAllocationsClientUpdateTagsOptions contains the optional parameters for the IPAllocationsClient.UpdateTags method. +type IPAllocationsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// IPConfiguration - IP configuration. +type IPConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the IP configuration. + Properties *IPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// IPConfigurationBgpPeeringAddress - Properties of IPConfigurationBgpPeeringAddress. +type IPConfigurationBgpPeeringAddress struct { + // The list of custom BGP peering addresses which belong to IP configuration. + CustomBgpIPAddresses []*string + + // The ID of IP configuration which belongs to gateway. + IPConfigurationID *string + + // READ-ONLY; The list of default BGP peering addresses which belong to IP configuration. + DefaultBgpIPAddresses []*string + + // READ-ONLY; The list of tunnel public IP addresses which belong to IP configuration. + TunnelIPAddresses []*string +} + +// IPConfigurationProfile - IP configuration profile child resource. +type IPConfigurationProfile struct { + // Resource ID. + ID *string + + // The name of the resource. This name can be used to access the resource. + Name *string + + // Properties of the IP configuration profile. + Properties *IPConfigurationProfilePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Sub Resource type. + Type *string +} + +// IPConfigurationProfilePropertiesFormat - IP configuration profile properties. +type IPConfigurationProfilePropertiesFormat struct { + // The reference to the subnet resource to create a container network interface ip configuration. + Subnet *Subnet + + // READ-ONLY; The provisioning state of the IP configuration profile resource. + ProvisioningState *ProvisioningState +} + +// IPConfigurationPropertiesFormat - Properties of IP configuration. +type IPConfigurationPropertiesFormat struct { + // The private IP address of the IP configuration. + PrivateIPAddress *string + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // The reference to the public IP resource. + PublicIPAddress *PublicIPAddress + + // The reference to the subnet resource. + Subnet *Subnet + + // READ-ONLY; The provisioning state of the IP configuration resource. + ProvisioningState *ProvisioningState +} + +// IPGroup - The IpGroups resource information. +type IPGroup struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the IpGroups. + Properties *IPGroupPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// IPGroupListResult - Response for the ListIpGroups API service call. +type IPGroupListResult struct { + // URL to get the next set of results. + NextLink *string + + // The list of IpGroups information resources. + Value []*IPGroup +} + +// IPGroupPropertiesFormat - The IpGroups property information. +type IPGroupPropertiesFormat struct { + // IpAddresses/IpAddressPrefixes in the IpGroups resource. + IPAddresses []*string + + // READ-ONLY; List of references to Firewall Policies resources that this IpGroups is associated with. + FirewallPolicies []*SubResource + + // READ-ONLY; List of references to Firewall resources that this IpGroups is associated with. + Firewalls []*SubResource + + // READ-ONLY; The provisioning state of the IpGroups resource. + ProvisioningState *ProvisioningState +} + +// IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate method. +type IPGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. +type IPGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. +type IPGroupsClientGetOptions struct { + // Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. + Expand *string +} + +// IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager +// method. +type IPGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// IPGroupsClientListOptions contains the optional parameters for the IPGroupsClient.NewListPager method. +type IPGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// IPGroupsClientUpdateGroupsOptions contains the optional parameters for the IPGroupsClient.UpdateGroups method. +type IPGroupsClientUpdateGroupsOptions struct { + // placeholder for future optional parameters +} + +// IPPrefixesList - List of SNAT IP Prefixes learnt by firewall to not SNAT +type IPPrefixesList struct { + // IP Prefix value. + IPPrefixes []*string +} + +// IPSecPolicy - An IPSec Policy configuration for a virtual network gateway connection. +type IPSecPolicy struct { + // REQUIRED; The DH Group used in IKE Phase 1 for initial SA. + DhGroup *DhGroup + + // REQUIRED; The IPSec encryption algorithm (IKE phase 1). + IPSecEncryption *IPSecEncryption + + // REQUIRED; The IPSec integrity algorithm (IKE phase 1). + IPSecIntegrity *IPSecIntegrity + + // REQUIRED; The IKE encryption algorithm (IKE phase 2). + IkeEncryption *IkeEncryption + + // REQUIRED; The IKE integrity algorithm (IKE phase 2). + IkeIntegrity *IkeIntegrity + + // REQUIRED; The Pfs Group used in IKE Phase 2 for new child SA. + PfsGroup *PfsGroup + + // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN + // tunnel. + SaDataSizeKilobytes *int32 + + // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site + // VPN tunnel. + SaLifeTimeSeconds *int32 +} + +// IPTag - Contains the IpTag associated with the object. +type IPTag struct { + // The IP tag type. Example: FirstPartyUsage. + IPTagType *string + + // The value of the IP tag associated with the public IP. Example: SQL. + Tag *string +} + +// IPv6CircuitConnectionConfig - IPv6 Circuit Connection properties for global reach. +type IPv6CircuitConnectionConfig struct { + // /125 IP address space to carve out customer addresses for global reach. + AddressPrefix *string + + // READ-ONLY; Express Route Circuit connection state. + CircuitConnectionStatus *CircuitConnectionStatus +} + +// IPv6ExpressRouteCircuitPeeringConfig - Contains IPv6 peering config. +type IPv6ExpressRouteCircuitPeeringConfig struct { + // The Microsoft peering configuration. + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig + + // The primary address prefix. + PrimaryPeerAddressPrefix *string + + // The reference to the RouteFilter resource. + RouteFilter *SubResource + + // The secondary address prefix. + SecondaryPeerAddressPrefix *string + + // The state of peering. + State *ExpressRouteCircuitPeeringState +} + +// InboundNatPool - Inbound NAT pool of the load balancer. +type InboundNatPool struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be + // used to access the resource. + Name *string + + // Properties of load balancer inbound nat pool. + Properties *InboundNatPoolPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// InboundNatPoolPropertiesFormat - Properties of Inbound NAT pool. +type InboundNatPoolPropertiesFormat struct { + // REQUIRED; The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + BackendPort *int32 + + // REQUIRED; The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated + // with a load balancer. Acceptable values range between 1 and 65535. + FrontendPortRangeEnd *int32 + + // REQUIRED; The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated + // with a load balancer. Acceptable values range between 1 and 65534. + FrontendPortRangeStart *int32 + + // REQUIRED; The reference to the transport protocol used by the inbound NAT pool. + Protocol *TransportProtocol + + // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability + // Group. This setting is required when using the SQL AlwaysOn Availability Groups + // in SQL server. This setting can't be changed after you create the endpoint. + EnableFloatingIP *bool + + // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used + // when the protocol is set to TCP. + EnableTCPReset *bool + + // A reference to frontend IP addresses. + FrontendIPConfiguration *SubResource + + // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. + // This element is only used when the protocol is set to TCP. + IdleTimeoutInMinutes *int32 + + // READ-ONLY; The provisioning state of the inbound NAT pool resource. + ProvisioningState *ProvisioningState +} + +// InboundNatRule - Inbound NAT rule of the load balancer. +type InboundNatRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be + // used to access the resource. + Name *string + + // Properties of load balancer inbound NAT rule. + Properties *InboundNatRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// InboundNatRuleListResult - Response for ListInboundNatRule API service call. +type InboundNatRuleListResult struct { + // A list of inbound NAT rules in a load balancer. + Value []*InboundNatRule + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// InboundNatRulePortMapping - Individual port mappings for inbound NAT rule created for backend pool. +type InboundNatRulePortMapping struct { + // READ-ONLY; Backend port. + BackendPort *int32 + + // READ-ONLY; Frontend port. + FrontendPort *int32 + + // READ-ONLY; Name of inbound NAT rule. + InboundNatRuleName *string + + // READ-ONLY; The reference to the transport protocol used by the inbound NAT rule. + Protocol *TransportProtocol +} + +// InboundNatRulePropertiesFormat - Properties of the inbound NAT rule. +type InboundNatRulePropertiesFormat struct { + // A reference to backendAddressPool resource. + BackendAddressPool *SubResource + + // The port used for the internal endpoint. Acceptable values range from 1 to 65535. + BackendPort *int32 + + // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability + // Group. This setting is required when using the SQL AlwaysOn Availability Groups + // in SQL server. This setting can't be changed after you create the endpoint. + EnableFloatingIP *bool + + // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used + // when the protocol is set to TCP. + EnableTCPReset *bool + + // A reference to frontend IP addresses. + FrontendIPConfiguration *SubResource + + // The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values + // range from 1 to 65534. + FrontendPort *int32 + + // The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. + // Individual inbound NAT rule port mappings will be created for each + // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + FrontendPortRangeEnd *int32 + + // The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. + // Individual inbound NAT rule port mappings will be created for each + // backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + FrontendPortRangeStart *int32 + + // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. + // This element is only used when the protocol is set to TCP. + IdleTimeoutInMinutes *int32 + + // The reference to the transport protocol used by the load balancing rule. + Protocol *TransportProtocol + + // READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port + // of each of the frontend IP configurations is forwarded to the backend IP. + BackendIPConfiguration *InterfaceIPConfiguration + + // READ-ONLY; The provisioning state of the inbound NAT rule resource. + ProvisioningState *ProvisioningState +} + +// InboundNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundNatRulesClient.BeginCreateOrUpdate +// method. +type InboundNatRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete method. +type InboundNatRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InboundNatRulesClientGetOptions contains the optional parameters for the InboundNatRulesClient.Get method. +type InboundNatRulesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.NewListPager method. +type InboundNatRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// InboundSecurityRule - NVA Inbound Security Rule resource. +type InboundSecurityRule struct { + // Resource ID. + ID *string + + // Name of security rule collection. + Name *string + + // The properties of the Inbound Security Rules. + Properties *InboundSecurityRuleProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; NVA inbound security rule type. + Type *string +} + +// InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate +// method. +type InboundSecurityRuleClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InboundSecurityRuleProperties - Properties of the Inbound Security Rules resource. +type InboundSecurityRuleProperties struct { + // List of allowed rules. + Rules []*InboundSecurityRules + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// InboundSecurityRules - Properties of the Inbound Security Rules resource. +type InboundSecurityRules struct { + // NVA port ranges to be opened up. One needs to provide specific ports. + DestinationPortRange *int32 + + // Protocol. This should be either TCP or UDP. + Protocol *InboundSecurityRulesProtocol + + // The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + SourceAddressPrefix *string +} + +// IntentPolicy - Network Intent Policy resource. +type IntentPolicy struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// IntentPolicyConfiguration - Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. +type IntentPolicyConfiguration struct { + // The name of the Network Intent Policy for storing in target subscription. + NetworkIntentPolicyName *string + + // Source network intent policy. + SourceNetworkIntentPolicy *IntentPolicy +} + +// Interface - A network interface in a resource group. +type Interface struct { + // The extended location of the network interface. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the network interface. + Properties *InterfacePropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// InterfaceAssociation - Network interface and its custom security rules. +type InterfaceAssociation struct { + // Collection of custom security rules. + SecurityRules []*SecurityRule + + // READ-ONLY; Network interface ID. + ID *string +} + +// InterfaceDNSSettings - DNS settings of a network interface. +type InterfaceDNSSettings struct { + // List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' + // value cannot be combined with other IPs, it must be the only value in dnsServers + // collection. + DNSServers []*string + + // Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + InternalDNSNameLabel *string + + // READ-ONLY; If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers + // from all NICs that are part of the Availability Set. This property is what is + // configured on each of those VMs. + AppliedDNSServers []*string + + // READ-ONLY; Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS + // name can be constructed by concatenating the VM name with the value of + // internalDomainNameSuffix. + InternalDomainNameSuffix *string + + // READ-ONLY; Fully qualified DNS name supporting internal communications between VMs in the same virtual network. + InternalFqdn *string +} + +// InterfaceIPConfiguration - IPConfiguration in a network interface. +type InterfaceIPConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Network interface IP configuration properties. + Properties *InterfaceIPConfigurationPropertiesFormat + + // Resource type. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// InterfaceIPConfigurationListResult - Response for list ip configurations API service call. +type InterfaceIPConfigurationListResult struct { + // A list of ip configurations. + Value []*InterfaceIPConfiguration + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// InterfaceIPConfigurationPrivateLinkConnectionProperties - PrivateLinkConnection properties for the network interface. +type InterfaceIPConfigurationPrivateLinkConnectionProperties struct { + // READ-ONLY; List of FQDNs for current private link connection. + Fqdns []*string + + // READ-ONLY; The group ID for current private link connection. + GroupID *string + + // READ-ONLY; The required member name for current private link connection. + RequiredMemberName *string +} + +// InterfaceIPConfigurationPropertiesFormat - Properties of IP configuration. +type InterfaceIPConfigurationPropertiesFormat struct { + // The reference to ApplicationGatewayBackendAddressPool resource. + ApplicationGatewayBackendAddressPools []*ApplicationGatewayBackendAddressPool + + // Application security groups in which the IP configuration is included. + ApplicationSecurityGroups []*ApplicationSecurityGroup + + // The reference to gateway load balancer frontend IP. + GatewayLoadBalancer *SubResource + + // The reference to LoadBalancerBackendAddressPool resource. + LoadBalancerBackendAddressPools []*BackendAddressPool + + // A list of references of LoadBalancerInboundNatRules. + LoadBalancerInboundNatRules []*InboundNatRule + + // Whether this is a primary customer address on the network interface. + Primary *bool + + // Private IP address of the IP configuration. + PrivateIPAddress *string + + // Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + PrivateIPAddressVersion *IPVersion + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // Public IP address bound to the IP configuration. + PublicIPAddress *PublicIPAddress + + // Subnet bound to the IP configuration. + Subnet *Subnet + + // The reference to Virtual Network Taps. + VirtualNetworkTaps []*VirtualNetworkTap + + // READ-ONLY; PrivateLinkConnection properties for the network interface. + PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties + + // READ-ONLY; The provisioning state of the network interface IP configuration. + ProvisioningState *ProvisioningState +} + +// InterfaceIPConfigurationsClientGetOptions contains the optional parameters for the InterfaceIPConfigurationsClient.Get +// method. +type InterfaceIPConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.NewListPager +// method. +type InterfaceIPConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// InterfaceListResult - Response for the ListNetworkInterface API service call. +type InterfaceListResult struct { + // A list of network interfaces in a resource group. + Value []*Interface + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// InterfaceLoadBalancerListResult - Response for list ip configurations API service call. +type InterfaceLoadBalancerListResult struct { + // A list of load balancers. + Value []*LoadBalancer + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.NewListPager +// method. +type InterfaceLoadBalancersClientListOptions struct { + // placeholder for future optional parameters +} + +// InterfacePropertiesFormat - NetworkInterface properties. +type InterfacePropertiesFormat struct { + // Auxiliary mode of Network Interface resource. + AuxiliaryMode *NetworkInterfaceAuxiliaryMode + + // The DNS settings in network interface. + DNSSettings *InterfaceDNSSettings + + // Indicates whether to disable tcp state tracking. + DisableTCPStateTracking *bool + + // If the network interface is configured for accelerated networking. Not applicable to VM sizes which require accelerated + // networking. + EnableAcceleratedNetworking *bool + + // Indicates whether IP forwarding is enabled on this network interface. + EnableIPForwarding *bool + + // A list of IPConfigurations of the network interface. + IPConfigurations []*InterfaceIPConfiguration + + // Migration phase of Network Interface resource. + MigrationPhase *NetworkInterfaceMigrationPhase + + // The reference to the NetworkSecurityGroup resource. + NetworkSecurityGroup *SecurityGroup + + // Type of Network Interface resource. + NicType *NetworkInterfaceNicType + + // Privatelinkservice of the network interface resource. + PrivateLinkService *PrivateLinkService + + // WorkloadType of the NetworkInterface for BareMetal resources + WorkloadType *string + + // READ-ONLY; A reference to the dscp configuration to which the network interface is linked. + DscpConfiguration *SubResource + + // READ-ONLY; A list of references to linked BareMetal resources. + HostedWorkloads []*string + + // READ-ONLY; The MAC address of the network interface. + MacAddress *string + + // READ-ONLY; Whether this is a primary network interface on a virtual machine. + Primary *bool + + // READ-ONLY; A reference to the private endpoint to which the network interface is linked. + PrivateEndpoint *PrivateEndpoint + + // READ-ONLY; The provisioning state of the network interface resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the network interface resource. + ResourceGUID *string + + // READ-ONLY; A list of TapConfigurations of the network interface. + TapConfigurations []*InterfaceTapConfiguration + + // READ-ONLY; The reference to a virtual machine. + VirtualMachine *SubResource + + // READ-ONLY; Whether the virtual machine this nic is attached to supports encryption. + VnetEncryptionSupported *bool +} + +// InterfaceTapConfiguration - Tap configuration in a Network Interface. +type InterfaceTapConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the Virtual Network Tap configuration. + Properties *InterfaceTapConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Sub Resource type. + Type *string +} + +// InterfaceTapConfigurationListResult - Response for list tap configurations API service call. +type InterfaceTapConfigurationListResult struct { + // A list of tap configurations. + Value []*InterfaceTapConfiguration + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// InterfaceTapConfigurationPropertiesFormat - Properties of Virtual Network Tap configuration. +type InterfaceTapConfigurationPropertiesFormat struct { + // The reference to the Virtual Network Tap resource. + VirtualNetworkTap *VirtualNetworkTap + + // READ-ONLY; The provisioning state of the network interface tap configuration resource. + ProvisioningState *ProvisioningState +} + +// InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate +// method. +type InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete +// method. +type InterfaceTapConfigurationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfaceTapConfigurationsClientGetOptions contains the optional parameters for the InterfaceTapConfigurationsClient.Get +// method. +type InterfaceTapConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.NewListPager +// method. +type InterfaceTapConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate +// method. +type InterfacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. +type InterfacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable +// method. +type InterfacesClientBeginGetEffectiveRouteTableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups +// method. +type InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InterfacesClientGetCloudServiceNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetCloudServiceNetworkInterface +// method. +type InterfacesClientGetCloudServiceNetworkInterfaceOptions struct { + // Expands referenced resources. + Expand *string +} + +// InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. +type InterfacesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetIPConfiguration +// method. +type InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions struct { + // Expands referenced resources. + Expand *string +} + +// InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions contains the optional parameters for the InterfacesClient.GetVirtualMachineScaleSetNetworkInterface +// method. +type InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions struct { + // Expands referenced resources. + Expand *string +} + +// InterfacesClientListAllOptions contains the optional parameters for the InterfacesClient.NewListAllPager method. +type InterfacesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceNetworkInterfacesPager +// method. +type InterfacesClientListCloudServiceNetworkInterfacesOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager +// method. +type InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientListOptions contains the optional parameters for the InterfacesClient.NewListPager method. +type InterfacesClientListOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager +// method. +type InterfacesClientListVirtualMachineScaleSetIPConfigurationsOptions struct { + // Expands referenced resources. + Expand *string +} + +// InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager +// method. +type InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager +// method. +type InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions struct { + // placeholder for future optional parameters +} + +// InterfacesClientUpdateTagsOptions contains the optional parameters for the InterfacesClient.UpdateTags method. +type InterfacesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ListHubRouteTablesResult - List of RouteTables and a URL nextLink to get the next set of results. +type ListHubRouteTablesResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of RouteTables. + Value []*HubRouteTable +} + +// ListHubVirtualNetworkConnectionsResult - List of HubVirtualNetworkConnections and a URL nextLink to get the next set of +// results. +type ListHubVirtualNetworkConnectionsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of HubVirtualNetworkConnections. + Value []*HubVirtualNetworkConnection +} + +// ListP2SVPNGatewaysResult - Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL +// nextLink to get the next set of results. +type ListP2SVPNGatewaysResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of P2SVpnGateways. + Value []*P2SVPNGateway +} + +// ListRouteMapsResult - List of RouteMaps and a URL nextLink to get the next set of results. +type ListRouteMapsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of RouteMaps. + Value []*RouteMap +} + +// ListRoutingIntentResult - List of the routing intent result and a URL nextLink to get the next set of results. +type ListRoutingIntentResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of RoutingIntent resource. + Value []*RoutingIntent +} + +// ListVPNConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains +// a list of Vpn Connections and a URL nextLink to get the next set of results. +type ListVPNConnectionsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of Vpn Connections. + Value []*VPNConnection +} + +// ListVPNGatewayNatRulesResult - Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a +// list of Nat rules and a URL nextLink to get the next set of results. +type ListVPNGatewayNatRulesResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of Nat Rules. + Value []*VPNGatewayNatRule +} + +// ListVPNGatewaysResult - Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink +// to get the next set of results. +type ListVPNGatewaysResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnGateways. + Value []*VPNGateway +} + +// ListVPNServerConfigurationPolicyGroupsResult - Result of the request to list VpnServerConfigurationPolicyGroups. It contains +// a list of VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. +type ListVPNServerConfigurationPolicyGroupsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnServerConfigurationPolicyGroups. + Value []*VPNServerConfigurationPolicyGroup +} + +// ListVPNServerConfigurationsResult - Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations +// and a URL nextLink to get the next set of results. +type ListVPNServerConfigurationsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnServerConfigurations. + Value []*VPNServerConfiguration +} + +// ListVPNSiteLinkConnectionsResult - Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains +// a list of Vpn Connections and a URL nextLink to get the next set of results. +type ListVPNSiteLinkConnectionsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnSiteLinkConnections. + Value []*VPNSiteLinkConnection +} + +// ListVPNSiteLinksResult - Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink +// to get the next set of results. +type ListVPNSiteLinksResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnSitesLinks. + Value []*VPNSiteLink +} + +// ListVPNSitesResult - Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the +// next set of results. +type ListVPNSitesResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VpnSites. + Value []*VPNSite +} + +// ListVirtualHubBgpConnectionResults - VirtualHubBgpConnections list. +type ListVirtualHubBgpConnectionResults struct { + // URL to get the next set of results. + NextLink *string + + // The list of VirtualHubBgpConnections. + Value []*BgpConnection +} + +// ListVirtualHubIPConfigurationResults - VirtualHubIpConfigurations list. +type ListVirtualHubIPConfigurationResults struct { + // URL to get the next set of results. + NextLink *string + + // The list of VirtualHubIpConfigurations. + Value []*HubIPConfiguration +} + +// ListVirtualHubRouteTableV2SResult - List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. +type ListVirtualHubRouteTableV2SResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VirtualHubRouteTableV2s. + Value []*VirtualHubRouteTableV2 +} + +// ListVirtualHubsResult - Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink +// to get the next set of results. +type ListVirtualHubsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VirtualHubs. + Value []*VirtualHub +} + +// ListVirtualNetworkGatewayNatRulesResult - Result of the request to list all nat rules to a virtual network gateway. It +// contains a list of Nat rules and a URL nextLink to get the next set of results. +type ListVirtualNetworkGatewayNatRulesResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of Nat Rules. + Value []*VirtualNetworkGatewayNatRule +} + +// ListVirtualWANsResult - Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink +// to get the next set of results. +type ListVirtualWANsResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of VirtualWANs. + Value []*VirtualWAN +} + +// LoadBalancer resource. +type LoadBalancer struct { + // The extended location of the load balancer. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of load balancer. + Properties *LoadBalancerPropertiesFormat + + // The load balancer SKU. + SKU *LoadBalancerSKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// LoadBalancerBackendAddress - Load balancer backend addresses. +type LoadBalancerBackendAddress struct { + // Name of the backend address. + Name *string + + // Properties of load balancer backend address pool. + Properties *LoadBalancerBackendAddressPropertiesFormat +} + +// LoadBalancerBackendAddressPoolListResult - Response for ListBackendAddressPool API service call. +type LoadBalancerBackendAddressPoolListResult struct { + // A list of backend address pools in a load balancer. + Value []*BackendAddressPool + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate +// method. +type LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete +// method. +type LoadBalancerBackendAddressPoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancerBackendAddressPoolsClientGetOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.Get +// method. +type LoadBalancerBackendAddressPoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.NewListPager +// method. +type LoadBalancerBackendAddressPoolsClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerBackendAddressPropertiesFormat - Properties of the load balancer backend addresses. +type LoadBalancerBackendAddressPropertiesFormat struct { + // A list of administrative states which once set can override health probe so that Load Balancer will always forward new + // connections to backend, or deny new connections and reset existing connections. + AdminState *LoadBalancerBackendAddressAdminState + + // IP Address belonging to the referenced virtual network. + IPAddress *string + + // Reference to the frontend ip address configuration defined in regional loadbalancer. + LoadBalancerFrontendIPConfiguration *SubResource + + // Reference to an existing subnet. + Subnet *SubResource + + // Reference to an existing virtual network. + VirtualNetwork *SubResource + + // READ-ONLY; Collection of inbound NAT rule port mappings. + InboundNatRulesPortMapping []*NatRulePortMapping + + // READ-ONLY; Reference to IP address defined in network interfaces. + NetworkInterfaceIPConfiguration *SubResource +} + +// LoadBalancerFrontendIPConfigurationListResult - Response for ListFrontendIPConfiguration API service call. +type LoadBalancerFrontendIPConfigurationListResult struct { + // A list of frontend IP configurations in a load balancer. + Value []*FrontendIPConfiguration + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerFrontendIPConfigurationsClientGetOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.Get +// method. +type LoadBalancerFrontendIPConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.NewListPager +// method. +type LoadBalancerFrontendIPConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerListResult - Response for ListLoadBalancers API service call. +type LoadBalancerListResult struct { + // A list of load balancers in a resource group. + Value []*LoadBalancer + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerLoadBalancingRuleListResult - Response for ListLoadBalancingRule API service call. +type LoadBalancerLoadBalancingRuleListResult struct { + // A list of load balancing rules in a load balancer. + Value []*LoadBalancingRule + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerLoadBalancingRulesClientGetOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.Get +// method. +type LoadBalancerLoadBalancingRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.NewListPager +// method. +type LoadBalancerLoadBalancingRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.NewListPager +// method. +type LoadBalancerNetworkInterfacesClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerOutboundRuleListResult - Response for ListOutboundRule API service call. +type LoadBalancerOutboundRuleListResult struct { + // A list of outbound rules in a load balancer. + Value []*OutboundRule + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerOutboundRulesClientGetOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.Get +// method. +type LoadBalancerOutboundRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.NewListPager +// method. +type LoadBalancerOutboundRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerProbeListResult - Response for ListProbe API service call. +type LoadBalancerProbeListResult struct { + // A list of probes in a load balancer. + Value []*Probe + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LoadBalancerProbesClientGetOptions contains the optional parameters for the LoadBalancerProbesClient.Get method. +type LoadBalancerProbesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.NewListPager method. +type LoadBalancerProbesClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancerPropertiesFormat - Properties of the load balancer. +type LoadBalancerPropertiesFormat struct { + // Collection of backend address pools used by a load balancer. + BackendAddressPools []*BackendAddressPool + + // Object representing the frontend IPs to be used for the load balancer. + FrontendIPConfigurations []*FrontendIPConfiguration + + // Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound + // NAT rules are created automatically for each NIC associated with the Load + // Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive + // with defining inbound NAT rules. Inbound NAT pools are referenced from virtual + // machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They + // have to reference individual inbound NAT rules. + InboundNatPools []*InboundNatPool + + // Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive + // with defining an inbound NAT pool. Inbound NAT pools are referenced from + // virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. + // They have to reference individual inbound NAT rules. + InboundNatRules []*InboundNatRule + + // Object collection representing the load balancing rules Gets the provisioning. + LoadBalancingRules []*LoadBalancingRule + + // The outbound rules. + OutboundRules []*OutboundRule + + // Collection of probe objects used in the load balancer. + Probes []*Probe + + // READ-ONLY; The provisioning state of the load balancer resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the load balancer resource. + ResourceGUID *string +} + +// LoadBalancerSKU - SKU of a load balancer. +type LoadBalancerSKU struct { + // Name of a load balancer SKU. + Name *LoadBalancerSKUName + + // Tier of a load balancer SKU. + Tier *LoadBalancerSKUTier +} + +// LoadBalancerVipSwapRequest - The request for a VIP swap. +type LoadBalancerVipSwapRequest struct { + // A list of frontend IP configuration resources that should swap VIPs. + FrontendIPConfigurations []*LoadBalancerVipSwapRequestFrontendIPConfiguration +} + +// LoadBalancerVipSwapRequestFrontendIPConfiguration - VIP swap request's frontend IP configuration object. +type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { + // The ID of frontend IP configuration resource. + ID *string + + // The properties of VIP swap request's frontend IP configuration object. + Properties *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties +} + +// LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - The properties of VIP swap request's frontend IP configuration +// object. +type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { + // A reference to public IP address resource. + PublicIPAddress *SubResource +} + +// LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate +// method. +type LoadBalancersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete method. +type LoadBalancersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings +// method. +type LoadBalancersClientBeginListInboundNatRulePortMappingsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses +// method. +type LoadBalancersClientBeginSwapPublicIPAddressesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +type LoadBalancersClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager method. +type LoadBalancersClientListAllOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.NewListPager method. +type LoadBalancersClientListOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientUpdateTagsOptions contains the optional parameters for the LoadBalancersClient.UpdateTags method. +type LoadBalancersClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancingRule - A load balancing rule for a load balancer. +type LoadBalancingRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can + // be used to access the resource. + Name *string + + // Properties of load balancer load balancing rule. + Properties *LoadBalancingRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// LoadBalancingRulePropertiesFormat - Properties of the load balancer. +type LoadBalancingRulePropertiesFormat struct { + // REQUIRED; The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable + // values are between 0 and 65534. Note that value 0 enables "Any Port". + FrontendPort *int32 + + // REQUIRED; The reference to the transport protocol used by the load balancing rule. + Protocol *TransportProtocol + + // A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + BackendAddressPool *SubResource + + // An array of references to pool of DIPs. + BackendAddressPools []*SubResource + + // The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables + // "Any Port". + BackendPort *int32 + + // Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing + // rule. + DisableOutboundSnat *bool + + // Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability + // Group. This setting is required when using the SQL AlwaysOn Availability Groups + // in SQL server. This setting can't be changed after you create the endpoint. + EnableFloatingIP *bool + + // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used + // when the protocol is set to TCP. + EnableTCPReset *bool + + // A reference to frontend IP addresses. + FrontendIPConfiguration *SubResource + + // The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. + // This element is only used when the protocol is set to TCP. + IdleTimeoutInMinutes *int32 + + // The load distribution policy for this rule. + LoadDistribution *LoadDistribution + + // The reference to the load balancer probe used by the load balancing rule. + Probe *SubResource + + // READ-ONLY; The provisioning state of the load balancing rule resource. + ProvisioningState *ProvisioningState +} + +// LocalNetworkGateway - A common class for general resource information. +type LocalNetworkGateway struct { + // REQUIRED; Properties of the local network gateway. + Properties *LocalNetworkGatewayPropertiesFormat + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// LocalNetworkGatewayListResult - Response for ListLocalNetworkGateways API service call. +type LocalNetworkGatewayListResult struct { + // A list of local network gateways that exists in a resource group. + Value []*LocalNetworkGateway + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// LocalNetworkGatewayPropertiesFormat - LocalNetworkGateway properties. +type LocalNetworkGatewayPropertiesFormat struct { + // Local network gateway's BGP speaker settings. + BgpSettings *BgpSettings + + // FQDN of local network gateway. + Fqdn *string + + // IP address of local network gateway. + GatewayIPAddress *string + + // Local network site address space. + LocalNetworkAddressSpace *AddressSpace + + // READ-ONLY; The provisioning state of the local network gateway resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the local network gateway resource. + ResourceGUID *string +} + +// LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate +// method. +type LocalNetworkGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete +// method. +type LocalNetworkGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get method. +type LocalNetworkGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager +// method. +type LocalNetworkGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// LocalNetworkGatewaysClientUpdateTagsOptions contains the optional parameters for the LocalNetworkGatewaysClient.UpdateTags +// method. +type LocalNetworkGatewaysClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// LogSpecification - Description of logging specification. +type LogSpecification struct { + // Duration of the blob. + BlobDuration *string + + // The display name of the specification. + DisplayName *string + + // The name of the specification. + Name *string +} + +// ManagedRuleGroupOverride - Defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // REQUIRED; The managed rule group to override. + RuleGroupName *string + + // List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules []*ManagedRuleOverride +} + +// ManagedRuleOverride - Defines a managed rule group override setting. +type ManagedRuleOverride struct { + // REQUIRED; Identifier for the managed rule. + RuleID *string + + // Describes the override action to be applied when rule matches. + Action *ActionType + + // The state of the managed rule. Defaults to Disabled if not specified. + State *ManagedRuleEnabledState +} + +// ManagedRuleSet - Defines a managed rule set. +type ManagedRuleSet struct { + // REQUIRED; Defines the rule set type to use. + RuleSetType *string + + // REQUIRED; Defines the version of the rule set to use. + RuleSetVersion *string + + // Defines the rule group overrides to apply to the rule set. + RuleGroupOverrides []*ManagedRuleGroupOverride +} + +// ManagedRulesDefinition - Allow to exclude some variable satisfy the condition for the WAF check. +type ManagedRulesDefinition struct { + // REQUIRED; The managed rule sets that are associated with the policy. + ManagedRuleSets []*ManagedRuleSet + + // The Exclusions that are applied on the policy. + Exclusions []*OwaspCrsExclusionEntry +} + +// ManagedServiceIdentity - Identity for the resource. +type ManagedServiceIdentity struct { + // The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + // identity and a set of user assigned identities. The type 'None' will remove any + // identities from the virtual machine. + Type *ResourceIdentityType + + // The list of user identities associated with resource. The user identity dictionary key references will be ARM resource + // ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + + // READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + +// ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink +// method. +type ManagementClientBeginDeleteBastionShareableLinkOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters for the +// ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. +type ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions +// method. +type ManagementClientBeginGetActiveSessionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink +// method. +type ManagementClientBeginPutBastionShareableLinkOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagementClientCheckDNSNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckDNSNameAvailability +// method. +type ManagementClientCheckDNSNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientDisconnectActiveSessionsOptions contains the optional parameters for the ManagementClient.NewDisconnectActiveSessionsPager +// method. +type ManagementClientDisconnectActiveSessionsOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort +// method. +type ManagementClientExpressRouteProviderPortOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientGetBastionShareableLinkOptions contains the optional parameters for the ManagementClient.NewGetBastionShareableLinkPager +// method. +type ManagementClientGetBastionShareableLinkOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientListActiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListActiveConnectivityConfigurations +// method. +type ManagementClientListActiveConnectivityConfigurationsOptions struct { + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagementClientListActiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListActiveSecurityAdminRules +// method. +type ManagementClientListActiveSecurityAdminRulesOptions struct { + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions contains the optional parameters for the ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations +// method. +type ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsOptions struct { + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions contains the optional parameters for the ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules +// method. +type ManagementClientListNetworkManagerEffectiveSecurityAdminRulesOptions struct { + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders +// method. +type ManagementClientSupportedSecurityProvidersOptions struct { + // placeholder for future optional parameters +} + +// ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate +// method. +type ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete +// method. +type ManagementGroupNetworkManagerConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get +// method. +type ManagementGroupNetworkManagerConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.NewListPager +// method. +type ManagementGroupNetworkManagerConnectionsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// Manager - The Managed Network resource +type Manager struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // The network manager properties + Properties *ManagerProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// ManagerCommit - Network Manager Commit. +type ManagerCommit struct { + // REQUIRED; Commit Type. + CommitType *ConfigurationType + + // REQUIRED; List of target locations. + TargetLocations []*string + + // List of configuration ids. + ConfigurationIDs []*string + + // READ-ONLY; Commit Id. + CommitID *string +} + +// ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost method. +type ManagerCommitsClientBeginPostOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagerConnection - The Network Manager Connection resource +type ManagerConnection struct { + // The scope connection properties + Properties *ManagerConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// ManagerConnectionListResult - List of network manager connections. +type ManagerConnectionListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // List of network manager connections. + Value []*ManagerConnection +} + +// ManagerConnectionProperties - Information about the network manager connection. +type ManagerConnectionProperties struct { + // A description of the network manager connection. + Description *string + + // Network Manager Id. + NetworkManagerID *string + + // READ-ONLY; Connection state. + ConnectionState *ScopeConnectionState +} + +// ManagerDeploymentStatus - Network Manager Deployment Status. +type ManagerDeploymentStatus struct { + // Commit Time. + CommitTime *time.Time + + // List of configuration ids. + ConfigurationIDs []*string + + // Deployment Status. + DeploymentStatus *DeploymentStatus + + // Configuration Deployment Type. + DeploymentType *ConfigurationType + + // Error Message. + ErrorMessage *string + + // Region Name. + Region *string +} + +// ManagerDeploymentStatusClientListOptions contains the optional parameters for the ManagerDeploymentStatusClient.List method. +type ManagerDeploymentStatusClientListOptions struct { + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagerDeploymentStatusListResult - A list of Network Manager Deployment Status +type ManagerDeploymentStatusListResult struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string + + // Gets a page of Network Manager Deployment Status + Value []*ManagerDeploymentStatus +} + +// ManagerDeploymentStatusParameter - Network Manager Deployment Status Parameter. +type ManagerDeploymentStatusParameter struct { + // List of deployment types. + DeploymentTypes []*ConfigurationType + + // List of locations. + Regions []*string + + // Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. + SkipToken *string +} + +// ManagerEffectiveConnectivityConfigurationListResult - Result of the request to list networkManagerEffectiveConnectivityConfiguration. +// It contains a list of groups and a skiptoken to get the next set of results. +type ManagerEffectiveConnectivityConfigurationListResult struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string + + // Gets a page of NetworkManagerEffectiveConnectivityConfiguration + Value []*EffectiveConnectivityConfiguration +} + +// ManagerEffectiveSecurityAdminRulesListResult - Result of the request to list networkManagerEffectiveSecurityAdminRules. +// It contains a list of groups and a skiptoken to get the next set of results. +type ManagerEffectiveSecurityAdminRulesListResult struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string + + // Gets a page of NetworkManagerEffectiveSecurityAdminRules + Value []EffectiveBaseSecurityAdminRuleClassification +} + +// ManagerListResult - Result of the request to list NetworkManager. It contains a list of network managers and a URL link +// to get the next set of results. +type ManagerListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NetworkManager + Value []*Manager +} + +// ManagerProperties - Properties of Managed Network +type ManagerProperties struct { + // REQUIRED; Scope Access. + NetworkManagerScopeAccesses []*ConfigurationType + + // REQUIRED; Scope of Network Manager. + NetworkManagerScopes *ManagerPropertiesNetworkManagerScopes + + // A description of the network manager. + Description *string + + // READ-ONLY; The provisioning state of the network manager resource. + ProvisioningState *ProvisioningState +} + +// ManagerPropertiesNetworkManagerScopes - Scope of Network Manager. +type ManagerPropertiesNetworkManagerScopes struct { + // List of management groups. + ManagementGroups []*string + + // List of subscriptions. + Subscriptions []*string + + // READ-ONLY; List of cross tenant scopes. + CrossTenantScopes []*CrossTenantScopes +} + +// ManagerSecurityGroupItem - Network manager security group item. +type ManagerSecurityGroupItem struct { + // REQUIRED; Network manager group Id. + NetworkGroupID *string +} + +// ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. +type ManagersClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagersClientCreateOrUpdateOptions contains the optional parameters for the ManagersClient.CreateOrUpdate method. +type ManagersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. +type ManagersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager +// method. +type ManagersClientListBySubscriptionOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. +type ManagersClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// ManagersClientPatchOptions contains the optional parameters for the ManagersClient.Patch method. +type ManagersClientPatchOptions struct { + // placeholder for future optional parameters +} + +// MatchCondition - Define match conditions. +type MatchCondition struct { + // REQUIRED; Match value. + MatchValues []*string + + // REQUIRED; List of match variables. + MatchVariables []*MatchVariable + + // REQUIRED; The operator to be matched. + Operator *WebApplicationFirewallOperator + + // Whether this is negate condition or not. + NegationConditon *bool + + // List of transforms. + Transforms []*WebApplicationFirewallTransform +} + +// MatchVariable - Define match variables. +type MatchVariable struct { + // REQUIRED; Match Variable. + VariableName *WebApplicationFirewallMatchVariable + + // The selector of match variable. + Selector *string +} + +// MatchedRule - Matched rule. +type MatchedRule struct { + // The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + Action *string + + // Name of the matched network security rule. + RuleName *string +} + +// MetricSpecification - Description of metrics specification. +type MetricSpecification struct { + // The aggregation type. + AggregationType *string + + // List of availability. + Availabilities []*Availability + + // List of dimensions. + Dimensions []*Dimension + + // The description of the metric. + DisplayDescription *string + + // The display name of the metric. + DisplayName *string + + // Whether regional MDM account enabled. + EnableRegionalMdmAccount *bool + + // Whether gaps would be filled with zeros. + FillGapWithZero *bool + + // Whether the metric is internal. + IsInternal *bool + + // Pattern for the filter of the metric. + MetricFilterPattern *string + + // The name of the metric. + Name *string + + // The resource Id dimension name override. + ResourceIDDimensionNameOverride *string + + // The source MDM account. + SourceMdmAccount *string + + // The source MDM namespace. + SourceMdmNamespace *string + + // Units the metric to be displayed in. + Unit *string +} + +// NatGateway - Nat Gateway resource. +type NatGateway struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Nat Gateway properties. + Properties *NatGatewayPropertiesFormat + + // The nat gateway SKU. + SKU *NatGatewaySKU + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting the zone in which Nat Gateway should be deployed. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// NatGatewayListResult - Response for ListNatGateways API service call. +type NatGatewayListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of Nat Gateways that exists in a resource group. + Value []*NatGateway +} + +// NatGatewayPropertiesFormat - Nat Gateway properties. +type NatGatewayPropertiesFormat struct { + // The idle timeout of the nat gateway. + IdleTimeoutInMinutes *int32 + + // An array of public ip addresses associated with the nat gateway resource. + PublicIPAddresses []*SubResource + + // An array of public ip prefixes associated with the nat gateway resource. + PublicIPPrefixes []*SubResource + + // READ-ONLY; The provisioning state of the NAT gateway resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the NAT gateway resource. + ResourceGUID *string + + // READ-ONLY; An array of references to the subnets using this nat gateway resource. + Subnets []*SubResource +} + +// NatGatewaySKU - SKU of nat gateway. +type NatGatewaySKU struct { + // Name of Nat Gateway SKU. + Name *NatGatewaySKUName +} + +// NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate +// method. +type NatGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. +type NatGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. +type NatGatewaysClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.NewListAllPager method. +type NatGatewaysClientListAllOptions struct { + // placeholder for future optional parameters +} + +// NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.NewListPager method. +type NatGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// NatGatewaysClientUpdateTagsOptions contains the optional parameters for the NatGatewaysClient.UpdateTags method. +type NatGatewaysClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// NatRule - Rule of type nat. +type NatRule struct { + // REQUIRED; Rule Type. + RuleType *FirewallPolicyRuleType + + // Description of the rule. + Description *string + + // List of destination IP addresses or Service Tags. + DestinationAddresses []*string + + // List of destination ports. + DestinationPorts []*string + + // Array of FirewallPolicyRuleNetworkProtocols. + IPProtocols []*FirewallPolicyRuleNetworkProtocol + + // Name of the rule. + Name *string + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string + + // The translated address for this NAT rule. + TranslatedAddress *string + + // The translated FQDN for this NAT rule. + TranslatedFqdn *string + + // The translated port for this NAT rule. + TranslatedPort *string +} + +// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type NatRule. +func (n *NatRule) GetFirewallPolicyRule() *FirewallPolicyRule { + return &FirewallPolicyRule{ + Name: n.Name, + Description: n.Description, + RuleType: n.RuleType, + } +} + +// NatRulePortMapping - Individual port mappings for inbound NAT rule created for backend pool. +type NatRulePortMapping struct { + // Backend port. + BackendPort *int32 + + // Frontend port. + FrontendPort *int32 + + // Name of inbound NAT rule. + InboundNatRuleName *string +} + +// NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate method. +type NatRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. +type NatRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NatRulesClientGetOptions contains the optional parameters for the NatRulesClient.Get method. +type NatRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.NewListByVPNGatewayPager +// method. +type NatRulesClientListByVPNGatewayOptions struct { + // placeholder for future optional parameters +} + +// NextHopParameters - Parameters that define the source and destination endpoint. +type NextHopParameters struct { + // REQUIRED; The destination IP address. + DestinationIPAddress *string + + // REQUIRED; The source IP address. + SourceIPAddress *string + + // REQUIRED; The resource identifier of the target resource against which the action is to be performed. + TargetResourceID *string + + // The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. + // Otherwise optional). + TargetNicResourceID *string +} + +// NextHopResult - The information about next hop from the specified VM. +type NextHopResult struct { + // Next hop IP Address. + NextHopIPAddress *string + + // Next hop type. + NextHopType *NextHopType + + // The resource identifier for the route table associated with the route being returned. If the route being returned does + // not correspond to any user created routes then this field will be the string + // 'System Route'. + RouteTableID *string +} + +// O365BreakOutCategoryPolicies - Office365 breakout categories. +type O365BreakOutCategoryPolicies struct { + // Flag to control allow category. + Allow *bool + + // Flag to control default category. + Default *bool + + // Flag to control optimize category. + Optimize *bool +} + +// O365PolicyProperties - The Office365 breakout policy. +type O365PolicyProperties struct { + // Office365 breakout categories. + BreakOutCategories *O365BreakOutCategoryPolicies +} + +// Office365PolicyProperties - Network Virtual Appliance Sku Properties. +type Office365PolicyProperties struct { + // Office 365 breakout categories. + BreakOutCategories *BreakOutCategoryPolicies +} + +// Operation - Network REST API operation definition. +type Operation struct { + // Display metadata associated with the operation. + Display *OperationDisplay + + // Operation name: {provider}/{resource}/{operation}. + Name *string + + // Origin of the operation. + Origin *string + + // Operation properties format. + Properties *OperationPropertiesFormat +} + +// OperationDisplay - Display metadata associated with the operation. +type OperationDisplay struct { + // Description of the operation. + Description *string + + // Type of the operation: get, read, delete, etc. + Operation *string + + // Service provider: Microsoft Network. + Provider *string + + // Resource on which the operation is performed. + Resource *string +} + +// OperationListResult - Result of the request to list Network operations. It contains a list of operations and a URL link +// to get the next set of results. +type OperationListResult struct { + // URL to get the next set of operation list results if there are any. + NextLink *string + + // List of Network operations supported by the Network resource provider. + Value []*Operation +} + +// OperationPropertiesFormat - Description of operation properties format. +type OperationPropertiesFormat struct { + // Specification of the service. + ServiceSpecification *OperationPropertiesFormatServiceSpecification +} + +// OperationPropertiesFormatServiceSpecification - Specification of the service. +type OperationPropertiesFormatServiceSpecification struct { + // Operation log specification. + LogSpecifications []*LogSpecification + + // Operation service specification. + MetricSpecifications []*MetricSpecification +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OrderBy - Describes a column to sort +type OrderBy struct { + // Describes the actual column name to sort by + Field *string + + // Describes if results should be in ascending/descending order + Order *FirewallPolicyIDPSQuerySortOrder +} + +// OutboundRule - Outbound rule of the load balancer. +type OutboundRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used + // to access the resource. + Name *string + + // Properties of load balancer outbound rule. + Properties *OutboundRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// OutboundRulePropertiesFormat - Outbound rule of the load balancer. +type OutboundRulePropertiesFormat struct { + // REQUIRED; A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + BackendAddressPool *SubResource + + // REQUIRED; The Frontend IP addresses of the load balancer. + FrontendIPConfigurations []*SubResource + + // REQUIRED; The protocol for the outbound rule in load balancer. + Protocol *LoadBalancerOutboundRuleProtocol + + // The number of outbound ports to be used for NAT. + AllocatedOutboundPorts *int32 + + // Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used + // when the protocol is set to TCP. + EnableTCPReset *bool + + // The timeout for the TCP idle connection. + IdleTimeoutInMinutes *int32 + + // READ-ONLY; The provisioning state of the outbound rule resource. + ProvisioningState *ProvisioningState +} + +// OwaspCrsExclusionEntry - Allow to exclude some variable satisfy the condition for the WAF check. +type OwaspCrsExclusionEntry struct { + // REQUIRED; The variable to be excluded. + MatchVariable *OwaspCrsExclusionEntryMatchVariable + + // REQUIRED; When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + // applies to. + Selector *string + + // REQUIRED; When matchVariable is a collection, operate on the selector to specify which elements in the collection this + // exclusion applies to. + SelectorMatchOperator *OwaspCrsExclusionEntrySelectorMatchOperator + + // The managed rule sets that are associated with the exclusion. + ExclusionManagedRuleSets []*ExclusionManagedRuleSet +} + +// P2SConnectionConfiguration Resource. +type P2SConnectionConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the P2S connection configuration. + Properties *P2SConnectionConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// P2SConnectionConfigurationProperties - Parameters for P2SConnectionConfiguration. +type P2SConnectionConfigurationProperties struct { + // Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. + EnableInternetSecurity *bool + + // The Routing Configuration indicating the associated and propagated route tables on this connection. + RoutingConfiguration *RoutingConfiguration + + // The reference to the address space resource which represents Address space for P2S VpnClient. + VPNClientAddressPool *AddressSpace + + // READ-ONLY; List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. + ConfigurationPolicyGroupAssociations []*SubResource + + // READ-ONLY; List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. + PreviousConfigurationPolicyGroupAssociations []*VPNServerConfigurationPolicyGroup + + // READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. + ProvisioningState *ProvisioningState +} + +// P2SVPNConnectionHealth - P2S Vpn connection detailed health written to sas url. +type P2SVPNConnectionHealth struct { + // Returned sas url of the blob to which the p2s vpn connection detailed health will be written. + SasURL *string +} + +// P2SVPNConnectionHealthRequest - List of P2S Vpn connection health request. +type P2SVPNConnectionHealthRequest struct { + // The sas-url to download the P2S Vpn connection health detail. + OutputBlobSasURL *string + + // The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. + VPNUserNamesFilter []*string +} + +// P2SVPNConnectionRequest - List of p2s vpn connections to be disconnected. +type P2SVPNConnectionRequest struct { + // List of p2s vpn connection Ids. + VPNConnectionIDs []*string +} + +// P2SVPNGateway - P2SVpnGateway Resource. +type P2SVPNGateway struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the P2SVpnGateway. + Properties *P2SVPNGatewayProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// P2SVPNGatewayProperties - Parameters for P2SVpnGateway. +type P2SVPNGatewayProperties struct { + // List of all customer specified DNS servers IP addresses. + CustomDNSServers []*string + + // Enable Routing Preference property for the Public IP Interface of the P2SVpnGateway. + IsRoutingPreferenceInternet *bool + + // List of all p2s connection configurations of the gateway. + P2SConnectionConfigurations []*P2SConnectionConfiguration + + // The scale unit for this p2s vpn gateway. + VPNGatewayScaleUnit *int32 + + // The VpnServerConfiguration to which the p2sVpnGateway is attached to. + VPNServerConfiguration *SubResource + + // The VirtualHub to which the gateway belongs. + VirtualHub *SubResource + + // READ-ONLY; The provisioning state of the P2S VPN gateway resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; All P2S VPN clients' connection health status. + VPNClientConnectionHealth *VPNClientConnectionHealth +} + +// P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate +// method. +type P2SVPNGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete method. +type P2SVPNGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections +// method. +type P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile +// method. +type P2SVPNGatewaysClientBeginGenerateVPNProfileOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed +// method. +type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth +// method. +type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset method. +type P2SVPNGatewaysClientBeginResetOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags +// method. +type P2SVPNGatewaysClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. +type P2SVPNGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager +// method. +type P2SVPNGatewaysClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListPager method. +type P2SVPNGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// P2SVPNProfileParameters - Vpn Client Parameters for package generation. +type P2SVPNProfileParameters struct { + // VPN client authentication method. + AuthenticationMethod *AuthenticationMethod +} + +// PacketCapture - Parameters that define the create packet capture operation. +type PacketCapture struct { + // REQUIRED; Properties of the packet capture. + Properties *PacketCaptureParameters +} + +// PacketCaptureFilter - Filter that is applied to packet capture request. Multiple filters can be applied. +type PacketCaptureFilter struct { + // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + // "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + // supported. Mixing ranges with multiple entries not currently supported. Default = null. + LocalIPAddress *string + + // Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple + // ranges not currently supported. Mixing ranges with multiple entries not + // currently supported. Default = null. + LocalPort *string + + // Protocol to be filtered on. + Protocol *PcProtocol + + // Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + // "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + // supported. Mixing ranges with multiple entries not currently supported. Default = null. + RemoteIPAddress *string + + // Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. + // Multiple ranges not currently supported. Mixing ranges with multiple entries not + // currently supported. Default = null. + RemotePort *string +} + +// PacketCaptureListResult - List of packet capture sessions. +type PacketCaptureListResult struct { + // Information about packet capture sessions. + Value []*PacketCaptureResult +} + +// PacketCaptureMachineScope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both +// included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. +type PacketCaptureMachineScope struct { + // List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. + Exclude []*string + + // List of AzureVMSS instances to run packet capture on. + Include []*string +} + +// PacketCaptureParameters - Parameters that define the create packet capture operation. +type PacketCaptureParameters struct { + // REQUIRED; The storage location for a packet capture session. + StorageLocation *PacketCaptureStorageLocation + + // REQUIRED; The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. + Target *string + + // Number of bytes captured per packet, the remaining bytes are truncated. + BytesToCapturePerPacket *int64 + + // A list of packet capture filters. + Filters []*PacketCaptureFilter + + // A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are + // empty, then the packet capture will run on all instances of AzureVMSS. + Scope *PacketCaptureMachineScope + + // Target type of the resource provided. + TargetType *PacketCaptureTargetType + + // Maximum duration of the capture session in seconds. + TimeLimitInSeconds *int32 + + // Maximum size of the capture output. + TotalBytesPerSession *int64 +} + +// PacketCaptureQueryStatusResult - Status of packet capture session. +type PacketCaptureQueryStatusResult struct { + // The start time of the packet capture session. + CaptureStartTime *time.Time + + // The ID of the packet capture resource. + ID *string + + // The name of the packet capture resource. + Name *string + + // List of errors of packet capture session. + PacketCaptureError []*PcError + + // The status of the packet capture session. + PacketCaptureStatus *PcStatus + + // The reason the current packet capture session was stopped. + StopReason *string +} + +// PacketCaptureResult - Information about packet capture session. +type PacketCaptureResult struct { + // Properties of the packet capture result. + Properties *PacketCaptureResultProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; ID of the packet capture operation. + ID *string + + // READ-ONLY; Name of the packet capture session. + Name *string +} + +// PacketCaptureResultProperties - The properties of a packet capture session. +type PacketCaptureResultProperties struct { + // REQUIRED; The storage location for a packet capture session. + StorageLocation *PacketCaptureStorageLocation + + // REQUIRED; The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. + Target *string + + // Number of bytes captured per packet, the remaining bytes are truncated. + BytesToCapturePerPacket *int64 + + // A list of packet capture filters. + Filters []*PacketCaptureFilter + + // A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are + // empty, then the packet capture will run on all instances of AzureVMSS. + Scope *PacketCaptureMachineScope + + // Target type of the resource provided. + TargetType *PacketCaptureTargetType + + // Maximum duration of the capture session in seconds. + TimeLimitInSeconds *int32 + + // Maximum size of the capture output. + TotalBytesPerSession *int64 + + // READ-ONLY; The provisioning state of the packet capture session. + ProvisioningState *ProvisioningState +} + +// PacketCaptureStorageLocation - The storage location for a packet capture session. +type PacketCaptureStorageLocation struct { + // A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it + // must start with /var/captures. Required if no storage ID is provided, otherwise + // optional. + FilePath *string + + // The ID of the storage account to save the packet capture session. Required if no local file path is provided. + StorageID *string + + // The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet + // capture. + StoragePath *string +} + +// PacketCapturesClientBeginCreateOptions contains the optional parameters for the PacketCapturesClient.BeginCreate method. +type PacketCapturesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete method. +type PacketCapturesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus +// method. +type PacketCapturesClientBeginGetStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop method. +type PacketCapturesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PacketCapturesClientGetOptions contains the optional parameters for the PacketCapturesClient.Get method. +type PacketCapturesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.NewListPager method. +type PacketCapturesClientListOptions struct { + // placeholder for future optional parameters +} + +// Parameters for an Action. +type Parameter struct { + // List of AS paths. + AsPath []*string + + // List of BGP communities. + Community []*string + + // List of route prefixes. + RoutePrefix []*string +} + +// PartnerManagedResourceProperties - Properties of the partner managed resource. +type PartnerManagedResourceProperties struct { + // READ-ONLY; The partner managed resource id. + ID *string + + // READ-ONLY; The partner managed ILB resource id + InternalLoadBalancerID *string + + // READ-ONLY; The partner managed SLB resource id + StandardLoadBalancerID *string +} + +// PatchObject - Object for patch operations. +type PatchObject struct { + // Resource tags. + Tags map[string]*string +} + +// PatchRouteFilter - Route Filter Resource. +type PatchRouteFilter struct { + // Resource ID. + ID *string + + // Properties of the route filter. + Properties *RouteFilterPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PatchRouteFilterRule - Route Filter Rule Resource. +type PatchRouteFilterRule struct { + // Resource ID. + ID *string + + // Properties of the route filter rule. + Properties *RouteFilterRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string +} + +// PeerExpressRouteCircuitConnection - Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. +type PeerExpressRouteCircuitConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the peer express route circuit connection. + Properties *PeerExpressRouteCircuitConnectionPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// PeerExpressRouteCircuitConnectionListResult - Response for ListPeeredConnections API service call retrieves all global +// reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. +type PeerExpressRouteCircuitConnectionListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. + Value []*PeerExpressRouteCircuitConnection +} + +// PeerExpressRouteCircuitConnectionPropertiesFormat - Properties of the peer express route circuit connection. +type PeerExpressRouteCircuitConnectionPropertiesFormat struct { + // /29 IP address space to carve out Customer addresses for tunnels. + AddressPrefix *string + + // The resource guid of the authorization used for the express route circuit connection. + AuthResourceGUID *string + + // The name of the express route circuit connection resource. + ConnectionName *string + + // Reference to Express Route Circuit Private Peering Resource of the circuit. + ExpressRouteCircuitPeering *SubResource + + // Reference to Express Route Circuit Private Peering Resource of the peered circuit. + PeerExpressRouteCircuitPeering *SubResource + + // READ-ONLY; Express Route Circuit connection state. + CircuitConnectionStatus *CircuitConnectionStatus + + // READ-ONLY; The provisioning state of the peer express route circuit connection resource. + ProvisioningState *ProvisioningState +} + +// PeerExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.Get +// method. +type PeerExpressRouteCircuitConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PeerExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.NewListPager +// method. +type PeerExpressRouteCircuitConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PeerRoute - Peer routing details. +type PeerRoute struct { + // READ-ONLY; The route's AS path sequence. + AsPath *string + + // READ-ONLY; The peer's local address. + LocalAddress *string + + // READ-ONLY; The route's network prefix. + Network *string + + // READ-ONLY; The route's next hop. + NextHop *string + + // READ-ONLY; The source this route was learned from. + Origin *string + + // READ-ONLY; The peer this route was learned from. + SourcePeer *string + + // READ-ONLY; The route's weight. + Weight *int32 +} + +// PeerRouteList - List of virtual router peer routes. +type PeerRouteList struct { + // List of peer routes. + Value []*PeerRoute +} + +// PolicySettings - Defines contents of a web application firewall global configuration. +type PolicySettings struct { + // If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + CustomBlockResponseBody *string + + // If the action type is block, customer can override the response status code. + CustomBlockResponseStatusCode *int32 + + // Maximum file upload size in Mb for WAF. + FileUploadLimitInMb *int32 + + // Maximum request body size in Kb for WAF. + MaxRequestBodySizeInKb *int32 + + // The mode of the policy. + Mode *WebApplicationFirewallMode + + // Whether to allow WAF to check request Body. + RequestBodyCheck *bool + + // The state of the policy. + State *WebApplicationFirewallEnabledState +} + +// PrepareNetworkPoliciesRequest - Details of PrepareNetworkPolicies for Subnet. +type PrepareNetworkPoliciesRequest struct { + // A list of NetworkIntentPolicyConfiguration. + NetworkIntentPolicyConfigurations []*IntentPolicyConfiguration + + // The name of the service for which subnet is being prepared for. + ServiceName *string +} + +// PrivateDNSZoneConfig - PrivateDnsZoneConfig resource. +type PrivateDNSZoneConfig struct { + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the private dns zone configuration. + Properties *PrivateDNSZonePropertiesFormat +} + +// PrivateDNSZoneGroup - Private dns zone group resource. +type PrivateDNSZoneGroup struct { + // Resource ID. + ID *string + + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the private dns zone group. + Properties *PrivateDNSZoneGroupPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// PrivateDNSZoneGroupListResult - Response for the ListPrivateDnsZoneGroups API service call. +type PrivateDNSZoneGroupListResult struct { + // A list of private dns zone group resources in a private endpoint. + Value []*PrivateDNSZoneGroup + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// PrivateDNSZoneGroupPropertiesFormat - Properties of the private dns zone group. +type PrivateDNSZoneGroupPropertiesFormat struct { + // A collection of private dns zone configurations of the private dns zone group. + PrivateDNSZoneConfigs []*PrivateDNSZoneConfig + + // READ-ONLY; The provisioning state of the private dns zone group resource. + ProvisioningState *ProvisioningState +} + +// PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate +// method. +type PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete +// method. +type PrivateDNSZoneGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateDNSZoneGroupsClientGetOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.Get method. +type PrivateDNSZoneGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.NewListPager +// method. +type PrivateDNSZoneGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateDNSZonePropertiesFormat - Properties of the private dns zone configuration resource. +type PrivateDNSZonePropertiesFormat struct { + // The resource id of the private dns zone. + PrivateDNSZoneID *string + + // READ-ONLY; A collection of information regarding a recordSet, holding information to identify private resources. + RecordSets []*RecordSet +} + +// PrivateEndpoint - Private endpoint resource. +type PrivateEndpoint struct { + // The extended location of the load balancer. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the private endpoint. + Properties *PrivateEndpointProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PrivateEndpointConnection resource. +type PrivateEndpointConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the private end point connection. + Properties *PrivateEndpointConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The resource type. + Type *string +} + +// PrivateEndpointConnectionListResult - Response for the ListPrivateEndpointConnection API service call. +type PrivateEndpointConnectionListResult struct { + // A list of PrivateEndpointConnection resources for a specific private link service. + Value []*PrivateEndpointConnection + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + + // READ-ONLY; The consumer link id. + LinkIdentifier *string + + // READ-ONLY; The resource of private end point. + PrivateEndpoint *PrivateEndpoint + + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *ProvisioningState +} + +// PrivateEndpointIPConfiguration - An IP Configuration of the private endpoint. +type PrivateEndpointIPConfiguration struct { + // The name of the resource that is unique within a resource group. + Name *string + + // Properties of private endpoint IP configurations. + Properties *PrivateEndpointIPConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The resource type. + Type *string +} + +// PrivateEndpointIPConfigurationProperties - Properties of an IP Configuration of the private endpoint. +type PrivateEndpointIPConfigurationProperties struct { + // The ID of a group obtained from the remote resource that this private endpoint should connect to. + GroupID *string + + // The member name of a group obtained from the remote resource that this private endpoint should connect to. + MemberName *string + + // A private ip address obtained from the private endpoint's subnet. + PrivateIPAddress *string +} + +// PrivateEndpointListResult - Response for the ListPrivateEndpoints API service call. +type PrivateEndpointListResult struct { + // A list of private endpoint resources in a resource group. + Value []*PrivateEndpoint + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// PrivateEndpointProperties - Properties of the private endpoint. +type PrivateEndpointProperties struct { + // Application security groups in which the private endpoint IP configuration is included. + ApplicationSecurityGroups []*ApplicationSecurityGroup + + // An array of custom dns configurations. + CustomDNSConfigs []*CustomDNSConfigPropertiesFormat + + // The custom name of the network interface attached to the private endpoint. + CustomNetworkInterfaceName *string + + // A list of IP configurations of the private endpoint. This will be used to map to the First Party Service's endpoints. + IPConfigurations []*PrivateEndpointIPConfiguration + + // A grouping of information about the connection to the remote resource. Used when the network admin does not have access + // to approve connections to the remote resource. + ManualPrivateLinkServiceConnections []*PrivateLinkServiceConnection + + // A grouping of information about the connection to the remote resource. + PrivateLinkServiceConnections []*PrivateLinkServiceConnection + + // The ID of the subnet from which the private IP will be allocated. + Subnet *Subnet + + // READ-ONLY; An array of references to the network interfaces created for this private endpoint. + NetworkInterfaces []*Interface + + // READ-ONLY; The provisioning state of the private endpoint resource. + ProvisioningState *ProvisioningState +} + +// PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete method. +type PrivateEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. +type PrivateEndpointsClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager +// method. +type PrivateEndpointsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager method. +type PrivateEndpointsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkService - Private link service resource. +type PrivateLinkService struct { + // The extended location of the load balancer. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the private link service. + Properties *PrivateLinkServiceProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PrivateLinkServiceConnection resource. +type PrivateLinkServiceConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the private link service connection. + Properties *PrivateLinkServiceConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The resource type. + Type *string +} + +// PrivateLinkServiceConnectionProperties - Properties of the PrivateLinkServiceConnection. +type PrivateLinkServiceConnectionProperties struct { + // The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. + GroupIDs []*string + + // A collection of read-only information about the state of the connection to the remote resource. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + + // The resource id of private link service. + PrivateLinkServiceID *string + + // A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. + RequestMessage *string + + // READ-ONLY; The provisioning state of the private link service connection resource. + ProvisioningState *ProvisioningState +} + +// 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. + ActionsRequired *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 *string +} + +// PrivateLinkServiceIPConfiguration - The private link service ip configuration. +type PrivateLinkServiceIPConfiguration struct { + // Resource ID. + ID *string + + // The name of private link service ip configuration. + Name *string + + // Properties of the private link service ip configuration. + Properties *PrivateLinkServiceIPConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The resource type. + Type *string +} + +// PrivateLinkServiceIPConfigurationProperties - Properties of private link service IP configuration. +type PrivateLinkServiceIPConfigurationProperties struct { + // Whether the ip configuration is primary or not. + Primary *bool + + // The private IP address of the IP configuration. + PrivateIPAddress *string + + // Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + PrivateIPAddressVersion *IPVersion + + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // The reference to the subnet resource. + Subnet *Subnet + + // READ-ONLY; The provisioning state of the private link service IP configuration resource. + ProvisioningState *ProvisioningState +} + +// PrivateLinkServiceListResult - Response for the ListPrivateLinkService API service call. +type PrivateLinkServiceListResult struct { + // A list of PrivateLinkService resources in a resource group. + Value []*PrivateLinkService + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// PrivateLinkServiceProperties - Properties of the private link service. +type PrivateLinkServiceProperties struct { + // The auto-approval list of the private link service. + AutoApproval *PrivateLinkServicePropertiesAutoApproval + + // Whether the private link service is enabled for proxy protocol or not. + EnableProxyProtocol *bool + + // The list of Fqdn. + Fqdns []*string + + // An array of private link service IP configurations. + IPConfigurations []*PrivateLinkServiceIPConfiguration + + // An array of references to the load balancer IP configurations. + LoadBalancerFrontendIPConfigurations []*FrontendIPConfiguration + + // The visibility list of the private link service. + Visibility *PrivateLinkServicePropertiesVisibility + + // READ-ONLY; The alias of the private link service. + Alias *string + + // READ-ONLY; An array of references to the network interfaces created for this private link service. + NetworkInterfaces []*Interface + + // READ-ONLY; An array of list about connections to the private endpoint. + PrivateEndpointConnections []*PrivateEndpointConnection + + // READ-ONLY; The provisioning state of the private link service resource. + ProvisioningState *ProvisioningState +} + +// PrivateLinkServicePropertiesAutoApproval - The auto-approval list of the private link service. +type PrivateLinkServicePropertiesAutoApproval struct { + // The list of subscriptions. + Subscriptions []*string +} + +// PrivateLinkServicePropertiesVisibility - The visibility list of the private link service. +type PrivateLinkServicePropertiesVisibility struct { + // The list of subscriptions. + Subscriptions []*string +} + +// PrivateLinkServiceVisibility - Response for the CheckPrivateLinkServiceVisibility API service call. +type PrivateLinkServiceVisibility struct { + // Private Link Service Visibility (True/False). + Visible *bool +} + +// PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions contains the optional parameters +// for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup method. +type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility +// method. +type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate +// method. +type PrivateLinkServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete +// method. +type PrivateLinkServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection +// method. +type PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. +type PrivateLinkServicesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// PrivateLinkServicesClientGetPrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.GetPrivateEndpointConnection +// method. +type PrivateLinkServicesClientGetPrivateEndpointConnectionOptions struct { + // Expands referenced resources. + Expand *string +} + +// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters for +// the PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager method. +type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager +// method. +type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager +// method. +type PrivateLinkServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager method. +type PrivateLinkServicesClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager +// method. +type PrivateLinkServicesClientListPrivateEndpointConnectionsOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.UpdatePrivateEndpointConnection +// method. +type PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// Probe - A load balancer probe. +type Probe struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access + // the resource. + Name *string + + // Properties of load balancer probe. + Properties *ProbePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// ProbePropertiesFormat - Load balancer probe resource. +type ProbePropertiesFormat struct { + // REQUIRED; The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + Port *int32 + + // REQUIRED; The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. + // If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required + // for the probe to be successful. + Protocol *ProbeProtocol + + // The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly + // less than half the allocated timeout period (in seconds) which allows two full + // probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. + IntervalInSeconds *int32 + + // The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. + // This values allows endpoints to be taken out of rotation faster or slower than + // the typical times used in Azure. + NumberOfProbes *int32 + + // The number of consecutive successful or failed probes in order to allow or deny traffic from being delivered to this endpoint. + // After failing the number of consecutive probes equal to this value, the + // endpoint will be taken out of rotation and require the same number of successful consecutive probes to be placed back in + // rotation. + ProbeThreshold *int32 + + // The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is + // not allowed. There is no default value. + RequestPath *string + + // READ-ONLY; The load balancer rules that use this probe. + LoadBalancingRules []*SubResource + + // READ-ONLY; The provisioning state of the probe resource. + ProvisioningState *ProvisioningState +} + +// Profile - Network profile resource. +type Profile struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Network profile properties. + Properties *ProfilePropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ProfileListResult - Response for ListNetworkProfiles API service call. +type ProfileListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of network profiles that exist in a resource group. + Value []*Profile +} + +// ProfilePropertiesFormat - Network profile properties. +type ProfilePropertiesFormat struct { + // List of chid container network interface configurations. + ContainerNetworkInterfaceConfigurations []*ContainerNetworkInterfaceConfiguration + + // READ-ONLY; List of child container network interfaces. + ContainerNetworkInterfaces []*ContainerNetworkInterface + + // READ-ONLY; The provisioning state of the network profile resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the network profile resource. + ResourceGUID *string +} + +// ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. +type ProfilesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method. +type ProfilesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. +type ProfilesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.NewListAllPager method. +type ProfilesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. +type ProfilesClientListOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientUpdateTagsOptions contains the optional parameters for the ProfilesClient.UpdateTags method. +type ProfilesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// PropagatedRouteTable - The list of RouteTables to advertise the routes to. +type PropagatedRouteTable struct { + // The list of resource ids of all the RouteTables. + IDs []*SubResource + + // The list of labels. + Labels []*string +} + +// ProtocolConfiguration - Configuration of the protocol. +type ProtocolConfiguration struct { + // HTTP configuration of the connectivity check. + HTTPConfiguration *HTTPConfiguration +} + +// PublicIPAddress - Public IP address resource. +type PublicIPAddress struct { + // The extended location of the public ip address. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Public IP address properties. + Properties *PublicIPAddressPropertiesFormat + + // The public IP address SKU. + SKU *PublicIPAddressSKU + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PublicIPAddressDNSSettings - Contains FQDN of the DNS record associated with the public IP address. +type PublicIPAddressDNSSettings struct { + // The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified + // domain name associated with the public IP address. If a domain name label is + // specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + DomainNameLabel *string + + // The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel + // and the regionalized DNS zone. + Fqdn *string + + // The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn + // is specified, then a PTR DNS record is created pointing from the IP address in + // the in-addr.arpa domain to the reverse FQDN. + ReverseFqdn *string +} + +// PublicIPAddressListResult - Response for ListPublicIpAddresses API service call. +type PublicIPAddressListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of public IP addresses that exists in a resource group. + Value []*PublicIPAddress +} + +// PublicIPAddressPropertiesFormat - Public IP address properties. +type PublicIPAddressPropertiesFormat struct { + // The FQDN of the DNS record associated with the public IP address. + DNSSettings *PublicIPAddressDNSSettings + + // The DDoS protection custom policy associated with the public IP address. + DdosSettings *DdosSettings + + // Specify what happens to the public IP address when the VM using it is deleted + DeleteOption *DeleteOptions + + // The IP address associated with the public IP address resource. + IPAddress *string + + // The list of tags associated with the public IP address. + IPTags []*IPTag + + // The idle timeout of the public IP address. + IdleTimeoutInMinutes *int32 + + // The linked public IP address of the public IP address resource. + LinkedPublicIPAddress *PublicIPAddress + + // Migration phase of Public IP Address. + MigrationPhase *PublicIPAddressMigrationPhase + + // The NatGateway for the Public IP address. + NatGateway *NatGateway + + // The public IP address version. + PublicIPAddressVersion *IPVersion + + // The public IP address allocation method. + PublicIPAllocationMethod *IPAllocationMethod + + // The Public IP Prefix this Public IP Address should be allocated from. + PublicIPPrefix *SubResource + + // The service public IP address of the public IP address resource. + ServicePublicIPAddress *PublicIPAddress + + // READ-ONLY; The IP configuration associated with the public IP address. + IPConfiguration *IPConfiguration + + // READ-ONLY; The provisioning state of the public IP address resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the public IP address resource. + ResourceGUID *string +} + +// PublicIPAddressSKU - SKU of a public IP address. +type PublicIPAddressSKU struct { + // Name of a public IP address SKU. + Name *PublicIPAddressSKUName + + // Tier of a public IP address SKU. + Tier *PublicIPAddressSKUTier +} + +// PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate +// method. +type PublicIPAddressesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus +// method. +type PublicIPAddressesClientBeginDdosProtectionStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete +// method. +type PublicIPAddressesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublicIPAddressesClientGetCloudServicePublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetCloudServicePublicIPAddress +// method. +type PublicIPAddressesClientGetCloudServicePublicIPAddressOptions struct { + // Expands referenced resources. + Expand *string +} + +// PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. +type PublicIPAddressesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress +// method. +type PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions struct { + // Expands referenced resources. + Expand *string +} + +// PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager +// method. +type PublicIPAddressesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager +// method. +type PublicIPAddressesClientListCloudServicePublicIPAddressesOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager +// method. +type PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager method. +type PublicIPAddressesClientListOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager +// method. +type PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager +// method. +type PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions struct { + // placeholder for future optional parameters +} + +// PublicIPAddressesClientUpdateTagsOptions contains the optional parameters for the PublicIPAddressesClient.UpdateTags method. +type PublicIPAddressesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// PublicIPDdosProtectionStatusResult - Response for GetPublicIpAddressDdosProtectionStatusOperation API service call. +type PublicIPDdosProtectionStatusResult struct { + // DDoS protection plan Resource Id of a if IP address is protected through a plan. + DdosProtectionPlanID *string + + // Value indicating whether the IP address is DDoS workload protected or not. + IsWorkloadProtected *IsWorkloadProtected + + // IP Address of the Public IP Resource + PublicIPAddress *string + + // Public IP ARM resource ID + PublicIPAddressID *string +} + +// PublicIPPrefix - Public IP prefix resource. +type PublicIPPrefix struct { + // The extended location of the public ip address. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Public IP prefix properties. + Properties *PublicIPPrefixPropertiesFormat + + // The public IP prefix SKU. + SKU *PublicIPPrefixSKU + + // Resource tags. + Tags map[string]*string + + // A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones []*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PublicIPPrefixListResult - Response for ListPublicIpPrefixes API service call. +type PublicIPPrefixListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of public IP prefixes that exists in a resource group. + Value []*PublicIPPrefix +} + +// PublicIPPrefixPropertiesFormat - Public IP prefix properties. +type PublicIPPrefixPropertiesFormat struct { + // The customIpPrefix that this prefix is associated with. + CustomIPPrefix *SubResource + + // The list of tags associated with the public IP prefix. + IPTags []*IPTag + + // NatGateway of Public IP Prefix. + NatGateway *NatGateway + + // The Length of the Public IP Prefix. + PrefixLength *int32 + + // The public IP address version. + PublicIPAddressVersion *IPVersion + + // READ-ONLY; The allocated Prefix. + IPPrefix *string + + // READ-ONLY; The reference to load balancer frontend IP configuration associated with the public IP prefix. + LoadBalancerFrontendIPConfiguration *SubResource + + // READ-ONLY; The provisioning state of the public IP prefix resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The list of all referenced PublicIPAddresses. + PublicIPAddresses []*ReferencedPublicIPAddress + + // READ-ONLY; The resource GUID property of the public IP prefix resource. + ResourceGUID *string +} + +// PublicIPPrefixSKU - SKU of a public IP prefix. +type PublicIPPrefixSKU struct { + // Name of a public IP prefix SKU. + Name *PublicIPPrefixSKUName + + // Tier of a public IP prefix SKU. + Tier *PublicIPPrefixSKUTier +} + +// PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate +// method. +type PublicIPPrefixesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete method. +type PublicIPPrefixesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. +type PublicIPPrefixesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager method. +type PublicIPPrefixesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager method. +type PublicIPPrefixesClientListOptions struct { + // placeholder for future optional parameters +} + +// PublicIPPrefixesClientUpdateTagsOptions contains the optional parameters for the PublicIPPrefixesClient.UpdateTags method. +type PublicIPPrefixesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// QosDefinition - Quality of Service defines the traffic configuration between endpoints. Mandatory to have one marking. +type QosDefinition struct { + // Destination IP ranges. + DestinationIPRanges []*QosIPRange + + // Destination port ranges. + DestinationPortRanges []*QosPortRange + + // List of markings to be used in the configuration. + Markings []*int32 + + // RNM supported protocol types. + Protocol *ProtocolType + + // Source IP ranges. + SourceIPRanges []*QosIPRange + + // Sources port ranges. + SourcePortRanges []*QosPortRange +} + +// QosIPRange - Qos Traffic Profiler IP Range properties. +type QosIPRange struct { + // End IP Address. + EndIP *string + + // Start IP Address. + StartIP *string +} + +// QosPortRange - Qos Traffic Profiler Port range properties. +type QosPortRange struct { + // Qos Port Range end. + End *int32 + + // Qos Port Range start. + Start *int32 +} + +// QueryInboundNatRulePortMappingRequest - The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or +// IpAddress should be set +type QueryInboundNatRulePortMappingRequest struct { + // IP address set in load balancer backend address. + IPAddress *string + + // NetworkInterfaceIPConfiguration set in load balancer backend address. + IPConfiguration *SubResource +} + +// QueryRequestOptions - Query Request Options +type QueryRequestOptions struct { + // When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current + // request) to retrieve the next page of data. + SkipToken *string +} + +// QueryResults - Query result +type QueryResults struct { + // Number of total records matching the query. + MatchingRecordsCount *int64 + + // Array containing the results of the query + Signatures []*SingleQueryResult +} + +// QueryTroubleshootingParameters - Parameters that define the resource to query the troubleshooting result. +type QueryTroubleshootingParameters struct { + // REQUIRED; The target resource ID to query the troubleshooting result. + TargetResourceID *string +} + +// RadiusServer - Radius Server Settings. +type RadiusServer struct { + // REQUIRED; The address of this radius server. + RadiusServerAddress *string + + // The initial score assigned to this radius server. + RadiusServerScore *int64 + + // The secret used for this radius server. + RadiusServerSecret *string +} + +// RecordSet - A collective group of information about the record set information. +type RecordSet struct { + // Fqdn that resolves to private endpoint ip address. + Fqdn *string + + // The private ip address of the private endpoint. + IPAddresses []*string + + // Recordset name. + RecordSetName *string + + // Resource record type. + RecordType *string + + // Recordset time to live. + TTL *int32 + + // READ-ONLY; The provisioning state of the recordset. + ProvisioningState *ProvisioningState +} + +// ReferencedPublicIPAddress - Reference to a public IP address. +type ReferencedPublicIPAddress struct { + // The PublicIPAddress Reference. + ID *string +} + +// Resource - Common resource representation. +type Resource struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ResourceNavigationLink resource. +type ResourceNavigationLink struct { + // Resource ID. + ID *string + + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Resource navigation link properties format. + Properties *ResourceNavigationLinkFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// ResourceNavigationLinkFormat - Properties of ResourceNavigationLink. +type ResourceNavigationLinkFormat struct { + // Link to the external resource. + Link *string + + // Resource type of the linked resource. + LinkedResourceType *string + + // READ-ONLY; The provisioning state of the resource navigation link resource. + ProvisioningState *ProvisioningState +} + +// ResourceNavigationLinksClientListOptions contains the optional parameters for the ResourceNavigationLinksClient.List method. +type ResourceNavigationLinksClientListOptions struct { + // placeholder for future optional parameters +} + +// ResourceNavigationLinksListResult - Response for ResourceNavigationLinks_List operation. +type ResourceNavigationLinksListResult struct { + // The resource navigation links in a subnet. + Value []*ResourceNavigationLink + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ResourceSet - The base resource set for visibility and auto-approval. +type ResourceSet struct { + // The list of subscriptions. + Subscriptions []*string +} + +// RetentionPolicyParameters - Parameters that define the retention policy for flow log. +type RetentionPolicyParameters struct { + // Number of days to retain flow log records. + Days *int32 + + // Flag to enable/disable retention. + Enabled *bool +} + +// Route resource. +type Route struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the route. + Properties *RoutePropertiesFormat + + // The type of the resource. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// RouteFilter - Route Filter Resource. +type RouteFilter struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the route filter. + Properties *RouteFilterPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// RouteFilterListResult - Response for the ListRouteFilters API service call. +type RouteFilterListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of route filters in a resource group. + Value []*RouteFilter +} + +// RouteFilterPropertiesFormat - Route Filter Resource. +type RouteFilterPropertiesFormat struct { + // Collection of RouteFilterRules contained within a route filter. + Rules []*RouteFilterRule + + // READ-ONLY; A collection of references to express route circuit ipv6 peerings. + IPv6Peerings []*ExpressRouteCircuitPeering + + // READ-ONLY; A collection of references to express route circuit peerings. + Peerings []*ExpressRouteCircuitPeering + + // READ-ONLY; The provisioning state of the route filter resource. + ProvisioningState *ProvisioningState +} + +// RouteFilterRule - Route Filter Rule Resource. +type RouteFilterRule struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the route filter rule. + Properties *RouteFilterRulePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// RouteFilterRuleListResult - Response for the ListRouteFilterRules API service call. +type RouteFilterRuleListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of RouteFilterRules in a resource group. + Value []*RouteFilterRule +} + +// RouteFilterRulePropertiesFormat - Route Filter Rule Resource. +type RouteFilterRulePropertiesFormat struct { + // REQUIRED; The access type of the rule. + Access *Access + + // REQUIRED; The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + Communities []*string + + // REQUIRED; The rule type of the rule. + RouteFilterRuleType *RouteFilterRuleType + + // READ-ONLY; The provisioning state of the route filter rule resource. + ProvisioningState *ProvisioningState +} + +// RouteFilterRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFilterRulesClient.BeginCreateOrUpdate +// method. +type RouteFilterRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete method. +type RouteFilterRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteFilterRulesClientGetOptions contains the optional parameters for the RouteFilterRulesClient.Get method. +type RouteFilterRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.NewListByRouteFilterPager +// method. +type RouteFilterRulesClientListByRouteFilterOptions struct { + // placeholder for future optional parameters +} + +// RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate +// method. +type RouteFiltersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete method. +type RouteFiltersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. +type RouteFiltersClientGetOptions struct { + // Expands referenced express route bgp peering resources. + Expand *string +} + +// RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager +// method. +type RouteFiltersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.NewListPager method. +type RouteFiltersClientListOptions struct { + // placeholder for future optional parameters +} + +// RouteFiltersClientUpdateTagsOptions contains the optional parameters for the RouteFiltersClient.UpdateTags method. +type RouteFiltersClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// RouteListResult - Response for the ListRoute API service call. +type RouteListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of routes in a resource group. + Value []*Route +} + +// RouteMap - The RouteMap child resource of a Virtual hub. +type RouteMap struct { + // Resource ID. + ID *string + + // Properties of the RouteMap resource. + Properties *RouteMapProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// RouteMapProperties - Properties of RouteMap resource +type RouteMapProperties struct { + // List of connections which have this RoutMap associated for inbound traffic. + AssociatedInboundConnections []*string + + // List of connections which have this RoutMap associated for outbound traffic. + AssociatedOutboundConnections []*string + + // List of RouteMap rules to be applied. + Rules []*RouteMapRule + + // READ-ONLY; The provisioning state of the RouteMap resource. + ProvisioningState *ProvisioningState +} + +// RouteMapRule - A RouteMap Rule. +type RouteMapRule struct { + // List of actions which will be applied on a match. + Actions []*Action + + // List of matching criterion which will be applied to traffic. + MatchCriteria []*Criterion + + // The unique name for the rule. + Name *string + + // Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. + NextStepIfMatched *NextStep +} + +// RouteMapsClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteMapsClient.BeginCreateOrUpdate +// method. +type RouteMapsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteMapsClientBeginDeleteOptions contains the optional parameters for the RouteMapsClient.BeginDelete method. +type RouteMapsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteMapsClientGetOptions contains the optional parameters for the RouteMapsClient.Get method. +type RouteMapsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RouteMapsClientListOptions contains the optional parameters for the RouteMapsClient.NewListPager method. +type RouteMapsClientListOptions struct { + // placeholder for future optional parameters +} + +// RoutePropertiesFormat - Route resource. +type RoutePropertiesFormat struct { + // REQUIRED; The type of Azure hop the packet should be sent to. + NextHopType *RouteNextHopType + + // The destination CIDR to which the route applies. + AddressPrefix *string + + // A value indicating whether this route overrides overlapping BGP routes regardless of LPM. + HasBgpOverride *bool + + // The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + NextHopIPAddress *string + + // READ-ONLY; The provisioning state of the route resource. + ProvisioningState *ProvisioningState +} + +// RouteTable - Route table resource. +type RouteTable struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the route table. + Properties *RouteTablePropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// RouteTableListResult - Response for the ListRouteTable API service call. +type RouteTableListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of route tables in a resource group. + Value []*RouteTable +} + +// RouteTablePropertiesFormat - Route Table resource. +type RouteTablePropertiesFormat struct { + // Whether to disable the routes learned by BGP on that route table. True means disable. + DisableBgpRoutePropagation *bool + + // Collection of routes contained within a route table. + Routes []*Route + + // READ-ONLY; The provisioning state of the route table resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the route table. + ResourceGUID *string + + // READ-ONLY; A collection of references to subnets. + Subnets []*Subnet +} + +// RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate +// method. +type RouteTablesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. +type RouteTablesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. +type RouteTablesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.NewListAllPager method. +type RouteTablesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.NewListPager method. +type RouteTablesClientListOptions struct { + // placeholder for future optional parameters +} + +// RouteTablesClientUpdateTagsOptions contains the optional parameters for the RouteTablesClient.UpdateTags method. +type RouteTablesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// RoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutesClient.BeginCreateOrUpdate method. +type RoutesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. +type RoutesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. +type RoutesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RoutesClientListOptions contains the optional parameters for the RoutesClient.NewListPager method. +type RoutesClientListOptions struct { + // placeholder for future optional parameters +} + +// RoutingConfiguration - Routing Configuration indicating the associated and propagated route tables for this connection. +type RoutingConfiguration struct { + // The resource id RouteTable associated with this RoutingConfiguration. + AssociatedRouteTable *SubResource + + // The resource id of the RouteMap associated with this RoutingConfiguration for inbound learned routes. + InboundRouteMap *SubResource + + // The resource id of theRouteMap associated with this RoutingConfiguration for outbound advertised routes. + OutboundRouteMap *SubResource + + // The list of RouteTables to advertise the routes to. + PropagatedRouteTables *PropagatedRouteTable + + // List of routes that control routing from VirtualHub into a virtual network connection. + VnetRoutes *VnetRoute +} + +// RoutingIntent - The routing intent child resource of a Virtual hub. +type RoutingIntent struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the RoutingIntent resource. + Properties *RoutingIntentProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate +// method. +type RoutingIntentClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete method. +type RoutingIntentClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutingIntentClientGetOptions contains the optional parameters for the RoutingIntentClient.Get method. +type RoutingIntentClientGetOptions struct { + // placeholder for future optional parameters +} + +// RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.NewListPager method. +type RoutingIntentClientListOptions struct { + // placeholder for future optional parameters +} + +// RoutingIntentProperties - The properties of a RoutingIntent resource. +type RoutingIntentProperties struct { + // List of routing policies. + RoutingPolicies []*RoutingPolicy + + // READ-ONLY; The provisioning state of the RoutingIntent resource. + ProvisioningState *ProvisioningState +} + +// RoutingPolicy - The routing policy object used in a RoutingIntent resource. +type RoutingPolicy struct { + // REQUIRED; List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). + Destinations []*string + + // REQUIRED; The unique name for the routing policy. + Name *string + + // REQUIRED; The next hop resource id on which this routing policy is applicable to. + NextHop *string +} + +// Rule of type network. +type Rule struct { + // REQUIRED; Rule Type. + RuleType *FirewallPolicyRuleType + + // Description of the rule. + Description *string + + // List of destination IP addresses or Service Tags. + DestinationAddresses []*string + + // List of destination FQDNs. + DestinationFqdns []*string + + // List of destination IpGroups for this rule. + DestinationIPGroups []*string + + // List of destination ports. + DestinationPorts []*string + + // Array of FirewallPolicyRuleNetworkProtocols. + IPProtocols []*FirewallPolicyRuleNetworkProtocol + + // Name of the rule. + Name *string + + // List of source IP addresses for this rule. + SourceAddresses []*string + + // List of source IpGroups for this rule. + SourceIPGroups []*string +} + +// GetFirewallPolicyRule implements the FirewallPolicyRuleClassification interface for type Rule. +func (r *Rule) GetFirewallPolicyRule() *FirewallPolicyRule { + return &FirewallPolicyRule{ + Name: r.Name, + Description: r.Description, + RuleType: r.RuleType, + } +} + +// SKU - The sku of this Bastion Host. +type SKU struct { + // The name of this Bastion Host. + Name *BastionHostSKUName +} + +// ScopeConnection - The Scope Connections resource +type ScopeConnection struct { + // The scope connection properties + Properties *ScopeConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// ScopeConnectionListResult - List of scope connections. +type ScopeConnectionListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // List of scope connections. + Value []*ScopeConnection +} + +// ScopeConnectionProperties - Scope connection. +type ScopeConnectionProperties struct { + // A description of the scope connection. + Description *string + + // Resource ID. + ResourceID *string + + // Tenant ID. + TenantID *string + + // READ-ONLY; Connection State + ConnectionState *ScopeConnectionState +} + +// ScopeConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ScopeConnectionsClient.CreateOrUpdate +// method. +type ScopeConnectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ScopeConnectionsClientDeleteOptions contains the optional parameters for the ScopeConnectionsClient.Delete method. +type ScopeConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ScopeConnectionsClientGetOptions contains the optional parameters for the ScopeConnectionsClient.Get method. +type ScopeConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager method. +type ScopeConnectionsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityAdminConfiguration - Defines the security admin configuration +type SecurityAdminConfiguration struct { + // Indicates the properties for the network manager security admin configuration. + Properties *SecurityAdminConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// SecurityAdminConfigurationListResult - A list of network manager security admin configurations +type SecurityAdminConfigurationListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of security admin configurations + Value []*SecurityAdminConfiguration +} + +// SecurityAdminConfigurationPropertiesFormat - Defines the security admin configuration properties. +type SecurityAdminConfigurationPropertiesFormat struct { + // Enum list of network intent policy based services. + ApplyOnNetworkIntentPolicyBasedServices []*NetworkIntentPolicyBasedService + + // A description of the security configuration. + Description *string + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// SecurityAdminConfigurationsClientBeginDeleteOptions contains the optional parameters for the SecurityAdminConfigurationsClient.BeginDelete +// method. +type SecurityAdminConfigurationsClientBeginDeleteOptions struct { + // Deletes the resource even if it is part of a deployed configuration. If the configuration has been deployed, the service + // will do a cleanup deployment in the background, prior to the delete. + Force *bool + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityAdminConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityAdminConfigurationsClient.CreateOrUpdate +// method. +type SecurityAdminConfigurationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityAdminConfigurationsClientGetOptions contains the optional parameters for the SecurityAdminConfigurationsClient.Get +// method. +type SecurityAdminConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.NewListPager +// method. +type SecurityAdminConfigurationsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityGroup - NetworkSecurityGroup resource. +type SecurityGroup struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the network security group. + Properties *SecurityGroupPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// SecurityGroupListResult - Response for ListNetworkSecurityGroups API service call. +type SecurityGroupListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of NetworkSecurityGroup resources. + Value []*SecurityGroup +} + +// SecurityGroupNetworkInterface - Network interface and all its associated security rules. +type SecurityGroupNetworkInterface struct { + // ID of the network interface. + ID *string + + // All security rules associated with the network interface. + SecurityRuleAssociations *SecurityRuleAssociations +} + +// SecurityGroupPropertiesFormat - Network Security Group resource. +type SecurityGroupPropertiesFormat struct { + // When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial + // enablement will trigger re-evaluation. + FlushConnection *bool + + // A collection of security rules of the network security group. + SecurityRules []*SecurityRule + + // READ-ONLY; The default security rules of network security group. + DefaultSecurityRules []*SecurityRule + + // READ-ONLY; A collection of references to flow log resources. + FlowLogs []*FlowLog + + // READ-ONLY; A collection of references to network interfaces. + NetworkInterfaces []*Interface + + // READ-ONLY; The provisioning state of the network security group resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the network security group resource. + ResourceGUID *string + + // READ-ONLY; A collection of references to subnets. + Subnets []*Subnet +} + +// SecurityGroupResult - Network configuration diagnostic result corresponded provided traffic query. +type SecurityGroupResult struct { + // The network traffic is allowed or denied. + SecurityRuleAccessResult *SecurityRuleAccess + + // READ-ONLY; List of results network security groups diagnostic. + EvaluatedNetworkSecurityGroups []*EvaluatedNetworkSecurityGroup +} + +// SecurityGroupViewParameters - Parameters that define the VM to check security groups for. +type SecurityGroupViewParameters struct { + // REQUIRED; ID of the target VM. + TargetResourceID *string +} + +// SecurityGroupViewResult - The information about security rules applied to the specified VM. +type SecurityGroupViewResult struct { + // List of network interfaces on the specified VM. + NetworkInterfaces []*SecurityGroupNetworkInterface +} + +// SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate +// method. +type SecurityGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete method. +type SecurityGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. +type SecurityGroupsClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager method. +type SecurityGroupsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.NewListPager method. +type SecurityGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityGroupsClientUpdateTagsOptions contains the optional parameters for the SecurityGroupsClient.UpdateTags method. +type SecurityGroupsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// SecurityPartnerProvider - Security Partner Provider resource. +type SecurityPartnerProvider struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the Security Partner Provider. + Properties *SecurityPartnerProviderPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// SecurityPartnerProviderListResult - Response for ListSecurityPartnerProviders API service call. +type SecurityPartnerProviderListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Security Partner Providers in a resource group. + Value []*SecurityPartnerProvider +} + +// SecurityPartnerProviderPropertiesFormat - Properties of the Security Partner Provider. +type SecurityPartnerProviderPropertiesFormat struct { + // The security provider name. + SecurityProviderName *SecurityProviderName + + // The virtualHub to which the Security Partner Provider belongs. + VirtualHub *SubResource + + // READ-ONLY; The connection status with the Security Partner Provider. + ConnectionStatus *SecurityPartnerProviderConnectionStatus + + // READ-ONLY; The provisioning state of the Security Partner Provider resource. + ProvisioningState *ProvisioningState +} + +// SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate +// method. +type SecurityPartnerProvidersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete +// method. +type SecurityPartnerProvidersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get method. +type SecurityPartnerProvidersClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager +// method. +type SecurityPartnerProvidersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager +// method. +type SecurityPartnerProvidersClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityPartnerProvidersClientUpdateTagsOptions contains the optional parameters for the SecurityPartnerProvidersClient.UpdateTags +// method. +type SecurityPartnerProvidersClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// SecurityRule - Network security rule. +type SecurityRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the security rule. + Properties *SecurityRulePropertiesFormat + + // The type of the resource. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// SecurityRuleAssociations - All security rules associated with the network interface. +type SecurityRuleAssociations struct { + // Collection of default security rules of the network security group. + DefaultSecurityRules []*SecurityRule + + // Collection of effective security rules. + EffectiveSecurityRules []*EffectiveNetworkSecurityRule + + // Network interface and it's custom security rules. + NetworkInterfaceAssociation *InterfaceAssociation + + // Subnet and it's custom security rules. + SubnetAssociation *SubnetAssociation +} + +// SecurityRuleListResult - Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a +// network security group. +type SecurityRuleListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The security rules in a network security group. + Value []*SecurityRule +} + +// SecurityRulePropertiesFormat - Security rule resource. +type SecurityRulePropertiesFormat struct { + // REQUIRED; The network traffic is allowed or denied. + Access *SecurityRuleAccess + + // REQUIRED; The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. + Direction *SecurityRuleDirection + + // REQUIRED; Network protocol this rule applies to. + Protocol *SecurityRuleProtocol + + // A description for this rule. Restricted to 140 chars. + Description *string + + // The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default + // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + // be used. + DestinationAddressPrefix *string + + // The destination address prefixes. CIDR or destination IP ranges. + DestinationAddressPrefixes []*string + + // The application security group specified as destination. + DestinationApplicationSecurityGroups []*ApplicationSecurityGroup + + // The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. + DestinationPortRange *string + + // The destination port ranges. + DestinationPortRanges []*string + + // The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the + // collection. The lower the priority number, the higher the priority of the rule. + Priority *int32 + + // The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress + // rule, specifies where network traffic originates from. + SourceAddressPrefix *string + + // The CIDR or source IP ranges. + SourceAddressPrefixes []*string + + // The application security group specified as source. + SourceApplicationSecurityGroups []*ApplicationSecurityGroup + + // The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. + SourcePortRange *string + + // The source port ranges. + SourcePortRanges []*string + + // READ-ONLY; The provisioning state of the security rule resource. + ProvisioningState *ProvisioningState +} + +// SecurityRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityRulesClient.BeginCreateOrUpdate +// method. +type SecurityRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete method. +type SecurityRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityRulesClientGetOptions contains the optional parameters for the SecurityRulesClient.Get method. +type SecurityRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.NewListPager method. +type SecurityRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityRulesEvaluationResult - Network security rules evaluation result. +type SecurityRulesEvaluationResult struct { + // Value indicating whether destination is matched. + DestinationMatched *bool + + // Value indicating whether destination port is matched. + DestinationPortMatched *bool + + // Name of the network security rule. + Name *string + + // Value indicating whether protocol is matched. + ProtocolMatched *bool + + // Value indicating whether source is matched. + SourceMatched *bool + + // Value indicating whether source port is matched. + SourcePortMatched *bool +} + +// ServiceAssociationLink resource. +type ServiceAssociationLink struct { + // Resource ID. + ID *string + + // Name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Resource navigation link properties format. + Properties *ServiceAssociationLinkPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// ServiceAssociationLinkPropertiesFormat - Properties of ServiceAssociationLink. +type ServiceAssociationLinkPropertiesFormat struct { + // If true, the resource can be deleted. + AllowDelete *bool + + // Link to the external resource. + Link *string + + // Resource type of the linked resource. + LinkedResourceType *string + + // A list of locations. + Locations []*string + + // READ-ONLY; The provisioning state of the service association link resource. + ProvisioningState *ProvisioningState +} + +// ServiceAssociationLinksClientListOptions contains the optional parameters for the ServiceAssociationLinksClient.List method. +type ServiceAssociationLinksClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceAssociationLinksListResult - Response for ServiceAssociationLinks_List operation. +type ServiceAssociationLinksListResult struct { + // The service association links in a subnet. + Value []*ServiceAssociationLink + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ServiceDelegationPropertiesFormat - Properties of a service delegation. +type ServiceDelegationPropertiesFormat struct { + // The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + ServiceName *string + + // READ-ONLY; The actions permitted to the service upon delegation. + Actions []*string + + // READ-ONLY; The provisioning state of the service delegation resource. + ProvisioningState *ProvisioningState +} + +// ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate +// method. +type ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete +// method. +type ServiceEndpointPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get method. +type ServiceEndpointPoliciesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager +// method. +type ServiceEndpointPoliciesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager +// method. +type ServiceEndpointPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceEndpointPoliciesClientUpdateTagsOptions contains the optional parameters for the ServiceEndpointPoliciesClient.UpdateTags +// method. +type ServiceEndpointPoliciesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ServiceEndpointPolicy - Service End point policy resource. +type ServiceEndpointPolicy struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the service end point policy. + Properties *ServiceEndpointPolicyPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Kind of service endpoint policy. This is metadata used for the Azure portal experience. + Kind *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ServiceEndpointPolicyDefinition - Service Endpoint policy definitions. +type ServiceEndpointPolicyDefinition struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the service endpoint policy definition. + Properties *ServiceEndpointPolicyDefinitionPropertiesFormat + + // The type of the resource. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// ServiceEndpointPolicyDefinitionListResult - Response for ListServiceEndpointPolicyDefinition API service call. Retrieves +// all service endpoint policy definition that belongs to a service endpoint policy. +type ServiceEndpointPolicyDefinitionListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The service endpoint policy definition in a service endpoint policy. + Value []*ServiceEndpointPolicyDefinition +} + +// ServiceEndpointPolicyDefinitionPropertiesFormat - Service Endpoint policy definition resource. +type ServiceEndpointPolicyDefinitionPropertiesFormat struct { + // A description for this rule. Restricted to 140 chars. + Description *string + + // Service endpoint name. + Service *string + + // A list of service resources. + ServiceResources []*string + + // READ-ONLY; The provisioning state of the service endpoint policy definition resource. + ProvisioningState *ProvisioningState +} + +// ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate +// method. +type ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete +// method. +type ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceEndpointPolicyDefinitionsClientGetOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.Get +// method. +type ServiceEndpointPolicyDefinitionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager +// method. +type ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceEndpointPolicyListResult - Response for ListServiceEndpointPolicies API service call. +type ServiceEndpointPolicyListResult struct { + // A list of ServiceEndpointPolicy resources. + Value []*ServiceEndpointPolicy + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ServiceEndpointPolicyPropertiesFormat - Service Endpoint Policy resource. +type ServiceEndpointPolicyPropertiesFormat struct { + // A collection of contextual service endpoint policy. + ContextualServiceEndpointPolicies []*string + + // The alias indicating if the policy belongs to a service + ServiceAlias *string + + // A collection of service endpoint policy definitions of the service endpoint policy. + ServiceEndpointPolicyDefinitions []*ServiceEndpointPolicyDefinition + + // READ-ONLY; The provisioning state of the service endpoint policy resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the service endpoint policy resource. + ResourceGUID *string + + // READ-ONLY; A collection of references to subnets. + Subnets []*Subnet +} + +// ServiceEndpointPropertiesFormat - The service endpoint properties. +type ServiceEndpointPropertiesFormat struct { + // A list of locations. + Locations []*string + + // The type of the endpoint service. + Service *string + + // READ-ONLY; The provisioning state of the service endpoint resource. + ProvisioningState *ProvisioningState +} + +// ServiceTagInformation - The service tag information. +type ServiceTagInformation struct { + // READ-ONLY; The ID of service tag. + ID *string + + // READ-ONLY; The name of service tag. + Name *string + + // READ-ONLY; Properties of the service tag information. + Properties *ServiceTagInformationPropertiesFormat + + // READ-ONLY; The iteration number of service tag object for region. + ServiceTagChangeNumber *string +} + +// ServiceTagInformationClientListOptions contains the optional parameters for the ServiceTagInformationClient.NewListPager +// method. +type ServiceTagInformationClientListOptions struct { + // Do not return address prefixes for the tag(s). + NoAddressPrefixes *bool + // Return tag information for a particular tag. + TagName *string +} + +// ServiceTagInformationListResult - Response for Get ServiceTagInformation API service call. Retrieves the list of service +// tag information resources. +type ServiceTagInformationListResult struct { + // The list of service tag information resources. + Value []*ServiceTagInformation + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// ServiceTagInformationPropertiesFormat - Properties of the service tag information. +type ServiceTagInformationPropertiesFormat struct { + // READ-ONLY; The list of IP address prefixes. + AddressPrefixes []*string + + // READ-ONLY; The iteration number of service tag. + ChangeNumber *string + + // READ-ONLY; The region of service tag. + Region *string + + // READ-ONLY; The state of the service tag. + State *string + + // READ-ONLY; The name of system service. + SystemService *string +} + +// ServiceTagsClientListOptions contains the optional parameters for the ServiceTagsClient.List method. +type ServiceTagsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceTagsListResult - Response for the ListServiceTags API service call. +type ServiceTagsListResult struct { + // READ-ONLY; The iteration number. + ChangeNumber *string + + // READ-ONLY; The name of the cloud. + Cloud *string + + // READ-ONLY; The ID of the cloud. + ID *string + + // READ-ONLY; The name of the cloud. + Name *string + + // READ-ONLY; The URL to get next page of service tag information resources. + NextLink *string + + // READ-ONLY; The azure resource type. + Type *string + + // READ-ONLY; The list of service tag information resources. + Values []*ServiceTagInformation +} + +// SessionIDs - List of session IDs. +type SessionIDs struct { + // List of session IDs. + SessionIDs []*string +} + +// SignatureOverridesFilterValuesQuery - Describes the filter values possibles for a given column +type SignatureOverridesFilterValuesQuery struct { + // Describes the name of the column which values will be returned + FilterName *string +} + +// SignatureOverridesFilterValuesResponse - Describes the list of all possible values for a specific filter value +type SignatureOverridesFilterValuesResponse struct { + // Describes the possible values + FilterValues []*string +} + +// SignaturesOverrides - Contains all specific policy signatures overrides for the IDPS +type SignaturesOverrides struct { + // Will contain the resource id of the signature override resource + ID *string + + // Contains the name of the resource (default) + Name *string + + // Will contain the properties of the resource (the actual signature overrides) + Properties *SignaturesOverridesProperties + + // Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + Type *string +} + +// SignaturesOverridesList - Describes an object containing an array with a single item +type SignaturesOverridesList struct { + // Describes a list consisting exactly one item describing the policy's signature override status + Value []*SignaturesOverrides +} + +// SignaturesOverridesProperties - Will contain the properties of the resource (the actual signature overrides) +type SignaturesOverridesProperties struct { + // Dictionary of + Signatures map[string]*string +} + +type SingleQueryResult struct { + // Describes what is the signature enforces + Description *string + + // Describes the list of destination ports related to this signature + DestinationPorts []*string + + // Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional + Direction *FirewallPolicyIDPSSignatureDirection + + // Describes the groups the signature belongs to + Group *string + + // Describes if this override is inherited from base policy or not + InheritedFromParentPolicy *bool + + // Describes the last updated time of the signature (provided from 3rd party vendor) + LastUpdated *string + + // The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + Mode *FirewallPolicyIDPSSignatureMode + + // Describes the protocol the signatures is being enforced in + Protocol *string + + // Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High + Severity *FirewallPolicyIDPSSignatureSeverity + + // The ID of the signature + SignatureID *int32 + + // Describes the list of source ports related to this signature + SourcePorts []*string +} + +// StaticMember Item. +type StaticMember struct { + // The Static Member properties + Properties *StaticMemberProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; The system metadata related to this resource. + SystemData *SystemData + + // READ-ONLY; Resource type. + Type *string +} + +// StaticMemberListResult - Result of the request to list StaticMember. It contains a list of groups and a URL link to get +// the next set of results. +type StaticMemberListResult struct { + // Gets the URL to get the next set of results. + NextLink *string + + // Gets a page of StaticMember + Value []*StaticMember +} + +// StaticMemberProperties - Properties of static member. +type StaticMemberProperties struct { + // Resource Id. + ResourceID *string + + // READ-ONLY; The provisioning state of the scope assignment resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Resource region. + Region *string +} + +// StaticMembersClientCreateOrUpdateOptions contains the optional parameters for the StaticMembersClient.CreateOrUpdate method. +type StaticMembersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// StaticMembersClientDeleteOptions contains the optional parameters for the StaticMembersClient.Delete method. +type StaticMembersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// StaticMembersClientGetOptions contains the optional parameters for the StaticMembersClient.Get method. +type StaticMembersClientGetOptions struct { + // placeholder for future optional parameters +} + +// StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.NewListPager method. +type StaticMembersClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// StaticRoute - List of all Static Routes. +type StaticRoute struct { + // List of all address prefixes. + AddressPrefixes []*string + + // The name of the StaticRoute that is unique within a VnetRoute. + Name *string + + // The ip address of the next hop. + NextHopIPAddress *string +} + +// StaticRoutesConfig - Configuration for static routes on this HubVnetConnectionConfiguration for static routes on this HubVnetConnection. +type StaticRoutesConfig struct { + // Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. + VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria + + // READ-ONLY; Boolean indicating whether static routes on this connection are automatically propagate to route tables which + // this connection propagates to. + PropagateStaticRoutes *bool +} + +// SubResource - Reference to another subresource. +type SubResource struct { + // Resource ID. + ID *string +} + +// Subnet in a virtual network resource. +type Subnet struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the subnet. + Properties *SubnetPropertiesFormat + + // Resource type. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// SubnetAssociation - Subnet and it's custom security rules. +type SubnetAssociation struct { + // Collection of custom security rules. + SecurityRules []*SecurityRule + + // READ-ONLY; Subnet ID. + ID *string +} + +// SubnetListResult - Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. +type SubnetListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The subnets in a virtual network. + Value []*Subnet +} + +// SubnetPropertiesFormat - Properties of the subnet. +type SubnetPropertiesFormat struct { + // The address prefix for the subnet. + AddressPrefix *string + + // List of address prefixes for the subnet. + AddressPrefixes []*string + + // Application gateway IP configurations of virtual network resource. + ApplicationGatewayIPConfigurations []*ApplicationGatewayIPConfiguration + + // An array of references to the delegations on the subnet. + Delegations []*Delegation + + // Array of IpAllocation which reference this subnet. + IPAllocations []*SubResource + + // Nat gateway associated with this subnet. + NatGateway *SubResource + + // The reference to the NetworkSecurityGroup resource. + NetworkSecurityGroup *SecurityGroup + + // Enable or Disable apply network policies on private end point in the subnet. + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies + + // Enable or Disable apply network policies on private link service in the subnet. + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies + + // The reference to the RouteTable resource. + RouteTable *RouteTable + + // An array of service endpoint policies. + ServiceEndpointPolicies []*ServiceEndpointPolicy + + // An array of service endpoints. + ServiceEndpoints []*ServiceEndpointPropertiesFormat + + // READ-ONLY; Array of IP configuration profiles which reference this subnet. + IPConfigurationProfiles []*IPConfigurationProfile + + // READ-ONLY; An array of references to the network interface IP configurations using subnet. + IPConfigurations []*IPConfiguration + + // READ-ONLY; An array of references to private endpoints. + PrivateEndpoints []*PrivateEndpoint + + // READ-ONLY; The provisioning state of the subnet resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; A read-only string identifying the intention of use for this subnet based on delegations and other user-defined + // properties. + Purpose *string + + // READ-ONLY; An array of references to the external resources using subnet. + ResourceNavigationLinks []*ResourceNavigationLink + + // READ-ONLY; An array of references to services injecting into this subnet. + ServiceAssociationLinks []*ServiceAssociationLink +} + +// SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate method. +type SubnetsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. +type SubnetsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubnetsClientBeginPrepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginPrepareNetworkPolicies +// method. +type SubnetsClientBeginPrepareNetworkPoliciesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubnetsClientBeginUnprepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginUnprepareNetworkPolicies +// method. +type SubnetsClientBeginUnprepareNetworkPoliciesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubnetsClientGetOptions contains the optional parameters for the SubnetsClient.Get method. +type SubnetsClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// SubnetsClientListOptions contains the optional parameters for the SubnetsClient.NewListPager method. +type SubnetsClientListOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate +// method. +type SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete +// method. +type SubscriptionNetworkManagerConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get +// method. +type SubscriptionNetworkManagerConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager +// method. +type SubscriptionNetworkManagerConnectionsClientListOptions struct { + // SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skipToken parameter that + // specifies a starting point to use for subsequent calls. + SkipToken *string + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SwapResource to represent slot type on the specified cloud service. +type SwapResource struct { + // Swap resource properties + Properties *SwapResourceProperties + + // READ-ONLY; Resource Id. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// SwapResourceListResult - SwapResource List with single entry to represent slot type on the specified cloud service. +type SwapResourceListResult struct { + Value []*SwapResource +} + +// SwapResourceProperties - Swap resource properties +type SwapResourceProperties struct { + // Specifies slot info on a cloud service + SlotType *SlotType +} + +// 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 type of identity that last modified the resource. + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + +// TagsObject - Tags object for patch operations. +type TagsObject struct { + // Resource tags. + Tags map[string]*string +} + +// Topology of the specified resource group. +type Topology struct { + // A list of topology resources. + Resources []*TopologyResource + + // READ-ONLY; The datetime when the topology was initially created for the resource group. + CreatedDateTime *time.Time + + // READ-ONLY; GUID representing the operation id. + ID *string + + // READ-ONLY; The datetime when the topology was last modified. + LastModified *time.Time +} + +// TopologyAssociation - Resources that have an association with the parent resource. +type TopologyAssociation struct { + // The association type of the child resource to the parent resource. + AssociationType *AssociationType + + // The name of the resource that is associated with the parent resource. + Name *string + + // The ID of the resource that is associated with the parent resource. + ResourceID *string +} + +// TopologyParameters - Parameters that define the representation of topology. +type TopologyParameters struct { + // The name of the target resource group to perform topology on. + TargetResourceGroupName *string + + // The reference to the Subnet resource. + TargetSubnet *SubResource + + // The reference to the Virtual Network resource. + TargetVirtualNetwork *SubResource +} + +// TopologyResource - The network resource topology information for the given resource group. +type TopologyResource struct { + // Holds the associations the resource has with other resources in the resource group. + Associations []*TopologyAssociation + + // ID of the resource. + ID *string + + // Resource location. + Location *string + + // Name of the resource. + Name *string +} + +// TrafficAnalyticsConfigurationProperties - Parameters that define the configuration of traffic analytics. +type TrafficAnalyticsConfigurationProperties struct { + // Flag to enable/disable traffic analytics. + Enabled *bool + + // The interval in minutes which would decide how frequently TA service should do flow analytics. + TrafficAnalyticsInterval *int32 + + // The resource guid of the attached workspace. + WorkspaceID *string + + // The location of the attached workspace. + WorkspaceRegion *string + + // Resource Id of the attached workspace. + WorkspaceResourceID *string +} + +// TrafficAnalyticsProperties - Parameters that define the configuration of traffic analytics. +type TrafficAnalyticsProperties struct { + // Parameters that define the configuration of traffic analytics. + NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties +} + +// TrafficSelectorPolicy - An traffic selector policy for a virtual network gateway connection. +type TrafficSelectorPolicy struct { + // REQUIRED; A collection of local address spaces in CIDR format. + LocalAddressRanges []*string + + // REQUIRED; A collection of remote address spaces in CIDR format. + RemoteAddressRanges []*string +} + +// TroubleshootingDetails - Information gained from troubleshooting of specified resource. +type TroubleshootingDetails struct { + // Details on troubleshooting results. + Detail *string + + // The id of the get troubleshoot operation. + ID *string + + // Reason type of failure. + ReasonType *string + + // List of recommended actions. + RecommendedActions []*TroubleshootingRecommendedActions + + // A summary of troubleshooting. + Summary *string +} + +// TroubleshootingParameters - Parameters that define the resource to troubleshoot. +type TroubleshootingParameters struct { + // REQUIRED; Properties of the troubleshooting resource. + Properties *TroubleshootingProperties + + // REQUIRED; The target resource to troubleshoot. + TargetResourceID *string +} + +// TroubleshootingProperties - Storage location provided for troubleshoot. +type TroubleshootingProperties struct { + // REQUIRED; The ID for the storage account to save the troubleshoot result. + StorageID *string + + // REQUIRED; The path to the blob to save the troubleshoot result in. + StoragePath *string +} + +// TroubleshootingRecommendedActions - Recommended actions based on discovered issues. +type TroubleshootingRecommendedActions struct { + // ID of the recommended action. + ActionID *string + + // Description of recommended actions. + ActionText *string + + // The uri linking to a documentation for the recommended troubleshooting actions. + ActionURI *string + + // The information from the URI for the recommended troubleshooting actions. + ActionURIText *string +} + +// TroubleshootingResult - Troubleshooting information gained from specified resource. +type TroubleshootingResult struct { + // The result code of the troubleshooting. + Code *string + + // The end time of the troubleshooting. + EndTime *time.Time + + // Information from troubleshooting. + Results []*TroubleshootingDetails + + // The start time of the troubleshooting. + StartTime *time.Time +} + +// TunnelConnectionHealth - VirtualNetworkGatewayConnection properties. +type TunnelConnectionHealth struct { + // READ-ONLY; Virtual Network Gateway connection status. + ConnectionStatus *VirtualNetworkGatewayConnectionStatus + + // READ-ONLY; The Egress Bytes Transferred in this connection. + EgressBytesTransferred *int64 + + // READ-ONLY; The Ingress Bytes Transferred in this connection. + IngressBytesTransferred *int64 + + // READ-ONLY; The time at which connection was established in Utc format. + LastConnectionEstablishedUTCTime *string + + // READ-ONLY; Tunnel name. + Tunnel *string +} + +// UnprepareNetworkPoliciesRequest - Details of UnprepareNetworkPolicies for Subnet. +type UnprepareNetworkPoliciesRequest struct { + // The name of the service for which subnet is being unprepared for. + ServiceName *string +} + +// Usage - The network resource usage. +type Usage struct { + // REQUIRED; The current value of the usage. + CurrentValue *int64 + + // REQUIRED; The limit of usage. + Limit *int64 + + // REQUIRED; The name of the type of usage. + Name *UsageName + + // REQUIRED; An enum describing the unit of measurement. + Unit *UsageUnit + + // READ-ONLY; Resource identifier. + ID *string +} + +// UsageName - The usage names. +type UsageName struct { + // A localized string describing the resource name. + LocalizedValue *string + + // A string describing the resource name. + Value *string +} + +// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. +type UsagesClientListOptions struct { + // placeholder for future optional parameters +} + +// UsagesListResult - The list usages operation response. +type UsagesListResult struct { + // URL to get the next set of results. + NextLink *string + + // The list network resource usages. + Value []*Usage +} + +// VM - Describes a Virtual Machine. +type VM struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNClientConfiguration - VpnClientConfiguration for P2S client. +type VPNClientConfiguration struct { + // The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. + AADAudience *string + + // The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. + AADIssuer *string + + // The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. + AADTenant *string + + // The radius server address property of the VirtualNetworkGateway resource for vpn client connection. + RadiusServerAddress *string + + // The radius secret property of the VirtualNetworkGateway resource for vpn client connection. + RadiusServerSecret *string + + // The radiusServers property for multiple radius server configuration. + RadiusServers []*RadiusServer + + // VPN authentication types for the virtual network gateway.. + VPNAuthenticationTypes []*VPNAuthenticationType + + // The reference to the address space resource which represents Address space for P2S VpnClient. + VPNClientAddressPool *AddressSpace + + // VpnClientIpsecPolicies for virtual network gateway P2S client. + VPNClientIPSecPolicies []*IPSecPolicy + + // VpnClientProtocols for Virtual network gateway. + VPNClientProtocols []*VPNClientProtocol + + // VpnClientRevokedCertificate for Virtual network gateway. + VPNClientRevokedCertificates []*VPNClientRevokedCertificate + + // VpnClientRootCertificate for virtual network gateway. + VPNClientRootCertificates []*VPNClientRootCertificate + + // per ip address pool connection policy for virtual network gateway P2S client. + VngClientConnectionConfigurations []*VngClientConnectionConfiguration +} + +// VPNClientConnectionHealth - VpnClientConnectionHealth properties. +type VPNClientConnectionHealth struct { + // List of allocated ip addresses to the connected p2s vpn clients. + AllocatedIPAddresses []*string + + // The total of p2s vpn clients connected at this time to this P2SVpnGateway. + VPNClientConnectionsCount *int32 + + // READ-ONLY; Total of the Egress Bytes Transferred in this connection. + TotalEgressBytesTransferred *int64 + + // READ-ONLY; Total of the Ingress Bytes Transferred in this P2S Vpn connection. + TotalIngressBytesTransferred *int64 +} + +// VPNClientConnectionHealthDetail - VPN client connection health detail. +type VPNClientConnectionHealthDetail struct { + // READ-ONLY; The egress bytes per second. + EgressBytesTransferred *int64 + + // READ-ONLY; The egress packets per second. + EgressPacketsTransferred *int64 + + // READ-ONLY; The ingress bytes per second. + IngressBytesTransferred *int64 + + // READ-ONLY; The ingress packets per second. + IngressPacketsTransferred *int64 + + // READ-ONLY; The max band width. + MaxBandwidth *int64 + + // READ-ONLY; The max packets transferred per second. + MaxPacketsPerSecond *int64 + + // READ-ONLY; The assigned private Ip of a connected vpn client. + PrivateIPAddress *string + + // READ-ONLY; The public Ip of a connected vpn client. + PublicIPAddress *string + + // READ-ONLY; The duration time of a connected vpn client. + VPNConnectionDuration *int64 + + // READ-ONLY; The vpn client Id. + VPNConnectionID *string + + // READ-ONLY; The start time of a connected vpn client. + VPNConnectionTime *string + + // READ-ONLY; The user name of a connected vpn client. + VPNUserName *string +} + +// VPNClientConnectionHealthDetailListResult - List of virtual network gateway vpn client connection health. +type VPNClientConnectionHealthDetailListResult struct { + // List of vpn client connection health. + Value []*VPNClientConnectionHealthDetail +} + +// VPNClientIPsecParameters - An IPSec parameters for a virtual network gateway P2S connection. +type VPNClientIPsecParameters struct { + // REQUIRED; The DH Group used in IKE Phase 1 for initial SA. + DhGroup *DhGroup + + // REQUIRED; The IPSec encryption algorithm (IKE phase 1). + IPSecEncryption *IPSecEncryption + + // REQUIRED; The IPSec integrity algorithm (IKE phase 1). + IPSecIntegrity *IPSecIntegrity + + // REQUIRED; The IKE encryption algorithm (IKE phase 2). + IkeEncryption *IkeEncryption + + // REQUIRED; The IKE integrity algorithm (IKE phase 2). + IkeIntegrity *IkeIntegrity + + // REQUIRED; The Pfs Group used in IKE Phase 2 for new child SA. + PfsGroup *PfsGroup + + // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + SaDataSizeKilobytes *int32 + + // REQUIRED; The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + SaLifeTimeSeconds *int32 +} + +// VPNClientParameters - Vpn Client Parameters for package generation. +type VPNClientParameters struct { + // VPN client authentication method. + AuthenticationMethod *AuthenticationMethod + + // A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external + // radius based authentication with EAPTLS. + ClientRootCertificates []*string + + // VPN client Processor Architecture. + ProcessorArchitecture *ProcessorArchitecture + + // The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only + // if external radius authentication has been configured with EAPTLS + // authentication. + RadiusServerAuthCertificate *string +} + +// VPNClientRevokedCertificate - VPN client revoked certificate of virtual network gateway. +type VPNClientRevokedCertificate struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the vpn client revoked certificate. + Properties *VPNClientRevokedCertificatePropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VPNClientRevokedCertificatePropertiesFormat - Properties of the revoked VPN client certificate of virtual network gateway. +type VPNClientRevokedCertificatePropertiesFormat struct { + // The revoked VPN client certificate thumbprint. + Thumbprint *string + + // READ-ONLY; The provisioning state of the VPN client revoked certificate resource. + ProvisioningState *ProvisioningState +} + +// VPNClientRootCertificate - VPN client root certificate of virtual network gateway. +type VPNClientRootCertificate struct { + // REQUIRED; Properties of the vpn client root certificate. + Properties *VPNClientRootCertificatePropertiesFormat + + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VPNClientRootCertificatePropertiesFormat - Properties of SSL certificates of application gateway. +type VPNClientRootCertificatePropertiesFormat struct { + // REQUIRED; The certificate public data. + PublicCertData *string + + // READ-ONLY; The provisioning state of the VPN client root certificate resource. + ProvisioningState *ProvisioningState +} + +// VPNConnection - VpnConnection Resource. +type VPNConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the VPN connection. + Properties *VPNConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VPNConnectionPacketCaptureStartParameters - Vpn Connection packet capture parameters supplied to start packet capture on +// gateway connection. +type VPNConnectionPacketCaptureStartParameters struct { + // Start Packet capture parameters on vpn connection. + FilterData *string + + // List of site link connection names. + LinkConnectionNames []*string +} + +// VPNConnectionPacketCaptureStopParameters - Vpn Connection packet capture parameters supplied to stop packet capture on +// gateway connection. +type VPNConnectionPacketCaptureStopParameters struct { + // List of site link connection names. + LinkConnectionNames []*string + + // SAS url for packet capture on vpn connection. + SasURL *string +} + +// VPNConnectionProperties - Parameters for VpnConnection. +type VPNConnectionProperties struct { + // Expected bandwidth in MBPS. + ConnectionBandwidth *int32 + + // DPD timeout in seconds for vpn connection. + DpdTimeoutSeconds *int32 + + // EnableBgp flag. + EnableBgp *bool + + // Enable internet security. + EnableInternetSecurity *bool + + // EnableBgp flag. + EnableRateLimiting *bool + + // The IPSec Policies to be considered by this connection. + IPSecPolicies []*IPSecPolicy + + // Id of the connected vpn site. + RemoteVPNSite *SubResource + + // The Routing Configuration indicating the associated and propagated route tables on this connection. + RoutingConfiguration *RoutingConfiguration + + // Routing weight for vpn connection. + RoutingWeight *int32 + + // SharedKey for the vpn connection. + SharedKey *string + + // The Traffic Selector Policies to be considered by this connection. + TrafficSelectorPolicies []*TrafficSelectorPolicy + + // Use local azure ip to initiate connection. + UseLocalAzureIPAddress *bool + + // Enable policy-based traffic selectors. + UsePolicyBasedTrafficSelectors *bool + + // Connection protocol used for this connection. + VPNConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol + + // List of all vpn site link connections to the gateway. + VPNLinkConnections []*VPNSiteLinkConnection + + // READ-ONLY; The connection status. + ConnectionStatus *VPNConnectionStatus + + // READ-ONLY; Egress bytes transferred. + EgressBytesTransferred *int64 + + // READ-ONLY; Ingress bytes transferred. + IngressBytesTransferred *int64 + + // READ-ONLY; The provisioning state of the VPN connection resource. + ProvisioningState *ProvisioningState +} + +// VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate +// method. +type VPNConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete method. +type VPNConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStartPacketCapture +// method. +type VPNConnectionsClientBeginStartPacketCaptureOptions struct { + // Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. + Parameters *VPNConnectionPacketCaptureStartParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStopPacketCapture +// method. +type VPNConnectionsClientBeginStopPacketCaptureOptions struct { + // Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + Parameters *VPNConnectionPacketCaptureStopParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNConnectionsClientGetOptions contains the optional parameters for the VPNConnectionsClient.Get method. +type VPNConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.NewListByVPNGatewayPager +// method. +type VPNConnectionsClientListByVPNGatewayOptions struct { + // placeholder for future optional parameters +} + +// VPNDeviceScriptParameters - Vpn device configuration script generation parameters. +type VPNDeviceScriptParameters struct { + // The device family for the vpn device. + DeviceFamily *string + + // The firmware version for the vpn device. + FirmwareVersion *string + + // The vendor for the vpn device. + Vendor *string +} + +// VPNGateway - VpnGateway Resource. +type VPNGateway struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the VPN gateway. + Properties *VPNGatewayProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNGatewayIPConfiguration - IP Configuration of a VPN Gateway Resource. +type VPNGatewayIPConfiguration struct { + // The identifier of the IP configuration for a VPN Gateway. + ID *string + + // The private IP address of this IP configuration. + PrivateIPAddress *string + + // The public IP address of this IP configuration. + PublicIPAddress *string +} + +// VPNGatewayNatRule - VpnGatewayNatRule Resource. +type VPNGatewayNatRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the VpnGateway NAT rule. + Properties *VPNGatewayNatRuleProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNGatewayNatRuleProperties - Parameters for VpnGatewayNatRule. +type VPNGatewayNatRuleProperties struct { + // The private IP address external mapping for NAT. + ExternalMappings []*VPNNatRuleMapping + + // The IP Configuration ID this NAT rule applies to. + IPConfigurationID *string + + // The private IP address internal mapping for NAT. + InternalMappings []*VPNNatRuleMapping + + // The Source NAT direction of a VPN NAT. + Mode *VPNNatRuleMode + + // The type of NAT rule for VPN NAT. + Type *VPNNatRuleType + + // READ-ONLY; List of egress VpnSiteLinkConnections. + EgressVPNSiteLinkConnections []*SubResource + + // READ-ONLY; List of ingress VpnSiteLinkConnections. + IngressVPNSiteLinkConnections []*SubResource + + // READ-ONLY; The provisioning state of the NAT Rule resource. + ProvisioningState *ProvisioningState +} + +// VPNGatewayPacketCaptureStartParameters - Start packet capture parameters. +type VPNGatewayPacketCaptureStartParameters struct { + // Start Packet capture parameters on vpn gateway. + FilterData *string +} + +// VPNGatewayPacketCaptureStopParameters - Stop packet capture parameters. +type VPNGatewayPacketCaptureStopParameters struct { + // SAS url for packet capture on vpn gateway. + SasURL *string +} + +// VPNGatewayProperties - Parameters for VpnGateway. +type VPNGatewayProperties struct { + // Local network gateway's BGP speaker settings. + BgpSettings *BgpSettings + + // List of all vpn connections to the gateway. + Connections []*VPNConnection + + // Enable BGP routes translation for NAT on this VpnGateway. + EnableBgpRouteTranslationForNat *bool + + // Enable Routing Preference property for the Public IP Interface of the VpnGateway. + IsRoutingPreferenceInternet *bool + + // List of all the nat Rules associated with the gateway. + NatRules []*VPNGatewayNatRule + + // The scale unit for this vpn gateway. + VPNGatewayScaleUnit *int32 + + // The VirtualHub to which the gateway belongs. + VirtualHub *SubResource + + // READ-ONLY; List of all IPs configured on the gateway. + IPConfigurations []*VPNGatewayIPConfiguration + + // READ-ONLY; The provisioning state of the VPN gateway resource. + ProvisioningState *ProvisioningState +} + +// VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate +// method. +type VPNGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. +type VPNGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. +type VPNGatewaysClientBeginResetOptions struct { + // VpnGateway ipConfigurationId to specify the gateway instance. + IPConfigurationID *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture +// method. +type VPNGatewaysClientBeginStartPacketCaptureOptions struct { + // Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + Parameters *VPNGatewayPacketCaptureStartParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture +// method. +type VPNGatewaysClientBeginStopPacketCaptureOptions struct { + // Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + Parameters *VPNGatewayPacketCaptureStopParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags method. +type VPNGatewaysClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. +type VPNGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager +// method. +type VPNGatewaysClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.NewListPager method. +type VPNGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// VPNLinkBgpSettings - BGP settings details for a link. +type VPNLinkBgpSettings struct { + // The BGP speaker's ASN. + Asn *int64 + + // The BGP peering address and BGP identifier of this BGP speaker. + BgpPeeringAddress *string +} + +// VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas +// method. +type VPNLinkConnectionsClientBeginGetIkeSasOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection +// method. +type VPNLinkConnectionsClientBeginResetConnectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNLinkConnectionsClientListByVPNConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.NewListByVPNConnectionPager +// method. +type VPNLinkConnectionsClientListByVPNConnectionOptions struct { + // placeholder for future optional parameters +} + +// VPNLinkProviderProperties - List of properties of a link provider. +type VPNLinkProviderProperties struct { + // Name of the link provider. + LinkProviderName *string + + // Link speed. + LinkSpeedInMbps *int32 +} + +// VPNNatRuleMapping - Vpn NatRule mapping. +type VPNNatRuleMapping struct { + // Address space for Vpn NatRule mapping. + AddressSpace *string + + // Port range for Vpn NatRule mapping. + PortRange *string +} + +// VPNPacketCaptureStartParameters - Start packet capture parameters on virtual network gateway. +type VPNPacketCaptureStartParameters struct { + // Start Packet capture parameters. + FilterData *string +} + +// VPNPacketCaptureStopParameters - Stop packet capture parameters. +type VPNPacketCaptureStopParameters struct { + // SAS url for packet capture on virtual network gateway. + SasURL *string +} + +// VPNProfileResponse - Vpn Profile Response for package generation. +type VPNProfileResponse struct { + // URL to the VPN profile. + ProfileURL *string +} + +// VPNServerConfigRadiusClientRootCertificate - Properties of the Radius client root certificate of VpnServerConfiguration. +type VPNServerConfigRadiusClientRootCertificate struct { + // The certificate name. + Name *string + + // The Radius client root certificate thumbprint. + Thumbprint *string +} + +// VPNServerConfigRadiusServerRootCertificate - Properties of Radius Server root certificate of VpnServerConfiguration. +type VPNServerConfigRadiusServerRootCertificate struct { + // The certificate name. + Name *string + + // The certificate public data. + PublicCertData *string +} + +// VPNServerConfigVPNClientRevokedCertificate - Properties of the revoked VPN client certificate of VpnServerConfiguration. +type VPNServerConfigVPNClientRevokedCertificate struct { + // The certificate name. + Name *string + + // The revoked VPN client certificate thumbprint. + Thumbprint *string +} + +// VPNServerConfigVPNClientRootCertificate - Properties of VPN client root certificate of VpnServerConfiguration. +type VPNServerConfigVPNClientRootCertificate struct { + // The certificate name. + Name *string + + // The certificate public data. + PublicCertData *string +} + +// VPNServerConfiguration - VpnServerConfiguration Resource. +type VPNServerConfiguration struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the P2SVpnServer configuration. + Properties *VPNServerConfigurationProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNServerConfigurationPolicyGroup - VpnServerConfigurationPolicyGroup Resource. +type VPNServerConfigurationPolicyGroup struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the VpnServerConfigurationPolicyGroup. + Properties *VPNServerConfigurationPolicyGroupProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNServerConfigurationPolicyGroupMember - VpnServerConfiguration PolicyGroup member +type VPNServerConfigurationPolicyGroupMember struct { + // The Vpn Policy member attribute type. + AttributeType *VPNPolicyMemberAttributeType + + // The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + AttributeValue *string + + // Name of the VpnServerConfigurationPolicyGroupMember. + Name *string +} + +// VPNServerConfigurationPolicyGroupProperties - Parameters for VpnServerConfigurationPolicyGroup. +type VPNServerConfigurationPolicyGroupProperties struct { + // Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + IsDefault *bool + + // Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + PolicyMembers []*VPNServerConfigurationPolicyGroupMember + + // Priority for VpnServerConfigurationPolicyGroup. + Priority *int32 + + // READ-ONLY; List of references to P2SConnectionConfigurations. + P2SConnectionConfigurations []*SubResource + + // READ-ONLY; The provisioning state of the VpnServerConfigurationPolicyGroup resource. + ProvisioningState *ProvisioningState +} + +// VPNServerConfigurationProperties - Parameters for VpnServerConfiguration. +type VPNServerConfigurationProperties struct { + // The set of aad vpn authentication parameters. + AADAuthenticationParameters *AADAuthenticationParameters + + // List of all VpnServerConfigurationPolicyGroups. + ConfigurationPolicyGroups []*VPNServerConfigurationPolicyGroup + + // The name of the VpnServerConfiguration that is unique within a resource group. + Name *string + + // Radius client root certificate of VpnServerConfiguration. + RadiusClientRootCertificates []*VPNServerConfigRadiusClientRootCertificate + + // The radius server address property of the VpnServerConfiguration resource for point to site client connection. + RadiusServerAddress *string + + // Radius Server root certificate of VpnServerConfiguration. + RadiusServerRootCertificates []*VPNServerConfigRadiusServerRootCertificate + + // The radius secret property of the VpnServerConfiguration resource for point to site client connection. + RadiusServerSecret *string + + // Multiple Radius Server configuration for VpnServerConfiguration. + RadiusServers []*RadiusServer + + // VPN authentication types for the VpnServerConfiguration. + VPNAuthenticationTypes []*VPNAuthenticationType + + // VpnClientIpsecPolicies for VpnServerConfiguration. + VPNClientIPSecPolicies []*IPSecPolicy + + // VPN client revoked certificate of VpnServerConfiguration. + VPNClientRevokedCertificates []*VPNServerConfigVPNClientRevokedCertificate + + // VPN client root certificate of VpnServerConfiguration. + VPNClientRootCertificates []*VPNServerConfigVPNClientRootCertificate + + // VPN protocols for the VpnServerConfiguration. + VPNProtocols []*VPNGatewayTunnelingProtocol + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; List of references to P2SVpnGateways. + P2SVPNGateways []*P2SVPNGateway + + // READ-ONLY; The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', + // and 'Failed'. + ProvisioningState *string +} + +// VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList +// method. +type VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate +// method. +type VPNServerConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete +// method. +type VPNServerConfigurationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get method. +type VPNServerConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager +// method. +type VPNServerConfigurationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager +// method. +type VPNServerConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// VPNServerConfigurationsClientUpdateTagsOptions contains the optional parameters for the VPNServerConfigurationsClient.UpdateTags +// method. +type VPNServerConfigurationsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VPNServerConfigurationsResponse - VpnServerConfigurations list associated with VirtualWan Response. +type VPNServerConfigurationsResponse struct { + // List of VpnServerConfigurations associated with VirtualWan. + VPNServerConfigurationResourceIDs []*string +} + +// VPNSite - VpnSite Resource. +type VPNSite struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the VPN site. + Properties *VPNSiteProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNSiteID - VpnSite Resource. +type VPNSiteID struct { + // READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. + VPNSite *string +} + +// VPNSiteLink - VpnSiteLink Resource. +type VPNSiteLink struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the VPN site link. + Properties *VPNSiteLinkProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNSiteLinkConnection - VpnSiteLinkConnection Resource. +type VPNSiteLinkConnection struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the VPN site link connection. + Properties *VPNSiteLinkConnectionProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// VPNSiteLinkConnectionProperties - Parameters for VpnConnection. +type VPNSiteLinkConnectionProperties struct { + // Expected bandwidth in MBPS. + ConnectionBandwidth *int32 + + // List of egress NatRules. + EgressNatRules []*SubResource + + // EnableBgp flag. + EnableBgp *bool + + // EnableBgp flag. + EnableRateLimiting *bool + + // The IPSec Policies to be considered by this connection. + IPSecPolicies []*IPSecPolicy + + // List of ingress NatRules. + IngressNatRules []*SubResource + + // Routing weight for vpn connection. + RoutingWeight *int32 + + // SharedKey for the vpn connection. + SharedKey *string + + // Use local azure ip to initiate connection. + UseLocalAzureIPAddress *bool + + // Enable policy-based traffic selectors. + UsePolicyBasedTrafficSelectors *bool + + // Connection protocol used for this connection. + VPNConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol + + // vpnGatewayCustomBgpAddresses used by this connection. + VPNGatewayCustomBgpAddresses []*GatewayCustomBgpIPAddressIPConfiguration + + // Vpn link connection mode. + VPNLinkConnectionMode *VPNLinkConnectionMode + + // Id of the connected vpn site link. + VPNSiteLink *SubResource + + // READ-ONLY; The connection status. + ConnectionStatus *VPNConnectionStatus + + // READ-ONLY; Egress bytes transferred. + EgressBytesTransferred *int64 + + // READ-ONLY; Ingress bytes transferred. + IngressBytesTransferred *int64 + + // READ-ONLY; The provisioning state of the VPN site link connection resource. + ProvisioningState *ProvisioningState +} + +// VPNSiteLinkConnectionsClientGetOptions contains the optional parameters for the VPNSiteLinkConnectionsClient.Get method. +type VPNSiteLinkConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNSiteLinkProperties - Parameters for VpnSite. +type VPNSiteLinkProperties struct { + // The set of bgp properties. + BgpProperties *VPNLinkBgpSettings + + // FQDN of vpn-site-link. + Fqdn *string + + // The ip-address for the vpn-site-link. + IPAddress *string + + // The link provider properties. + LinkProperties *VPNLinkProviderProperties + + // READ-ONLY; The provisioning state of the VPN site link resource. + ProvisioningState *ProvisioningState +} + +// VPNSiteLinksClientGetOptions contains the optional parameters for the VPNSiteLinksClient.Get method. +type VPNSiteLinksClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.NewListByVPNSitePager +// method. +type VPNSiteLinksClientListByVPNSiteOptions struct { + // placeholder for future optional parameters +} + +// VPNSiteProperties - Parameters for VpnSite. +type VPNSiteProperties struct { + // The AddressSpace that contains an array of IP address ranges. + AddressSpace *AddressSpace + + // The set of bgp properties. + BgpProperties *BgpSettings + + // The device properties. + DeviceProperties *DeviceProperties + + // The ip-address for the vpn-site. + IPAddress *string + + // IsSecuritySite flag. + IsSecuritySite *bool + + // Office365 Policy. + O365Policy *O365PolicyProperties + + // The key for vpn-site that can be used for connections. + SiteKey *string + + // List of all vpn site links. + VPNSiteLinks []*VPNSiteLink + + // The VirtualWAN to which the vpnSite belongs. + VirtualWan *SubResource + + // READ-ONLY; The provisioning state of the VPN site resource. + ProvisioningState *ProvisioningState +} + +// VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate method. +type VPNSitesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. +type VPNSitesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. +type VPNSitesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager +// method. +type VPNSitesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.NewListPager method. +type VPNSitesClientListOptions struct { + // placeholder for future optional parameters +} + +// VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method. +type VPNSitesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload +// method. +type VPNSitesConfigurationClientBeginDownloadOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VerificationIPFlowParameters - Parameters that define the IP flow to be verified. +type VerificationIPFlowParameters struct { + // REQUIRED; The direction of the packet represented as a 5-tuple. + Direction *Direction + + // REQUIRED; The local IP address. Acceptable values are valid IPv4 addresses. + LocalIPAddress *string + + // REQUIRED; The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, + // which depends on the direction. + LocalPort *string + + // REQUIRED; Protocol to be verified on. + Protocol *IPFlowProtocol + + // REQUIRED; The remote IP address. Acceptable values are valid IPv4 addresses. + RemoteIPAddress *string + + // REQUIRED; The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source + // port, which depends on the direction. + RemotePort *string + + // REQUIRED; The ID of the target resource to perform next-hop on. + TargetResourceID *string + + // The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. + // Otherwise optional). + TargetNicResourceID *string +} + +// VerificationIPFlowResult - Results of IP flow verification on the target resource. +type VerificationIPFlowResult struct { + // Indicates whether the traffic is allowed or denied. + Access *Access + + // Name of the rule. If input is not matched against any security rule, it is not displayed. + RuleName *string +} + +// VipSwapClientBeginCreateOptions contains the optional parameters for the VipSwapClient.BeginCreate method. +type VipSwapClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VipSwapClientGetOptions contains the optional parameters for the VipSwapClient.Get method. +type VipSwapClientGetOptions struct { + // placeholder for future optional parameters +} + +// VipSwapClientListOptions contains the optional parameters for the VipSwapClient.List method. +type VipSwapClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualAppliance - NetworkVirtualAppliance Resource. +type VirtualAppliance struct { + // Resource ID. + ID *string + + // The service principal that has read access to cloud-init and config blob. + Identity *ManagedServiceIdentity + + // Resource location. + Location *string + + // Properties of the Network Virtual Appliance. + Properties *VirtualAppliancePropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualApplianceListResult - Response for ListNetworkVirtualAppliances API service call. +type VirtualApplianceListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Network Virtual Appliances. + Value []*VirtualAppliance +} + +// VirtualApplianceNicProperties - Network Virtual Appliance NIC properties. +type VirtualApplianceNicProperties struct { + // READ-ONLY; NIC name. + Name *string + + // READ-ONLY; Private IP address. + PrivateIPAddress *string + + // READ-ONLY; Public IP address. + PublicIPAddress *string +} + +// VirtualAppliancePropertiesFormat - Network Virtual Appliance definition. +type VirtualAppliancePropertiesFormat struct { + // BootStrapConfigurationBlobs storage URLs. + BootStrapConfigurationBlobs []*string + + // CloudInitConfiguration string in plain text. + CloudInitConfiguration *string + + // CloudInitConfigurationBlob storage URLs. + CloudInitConfigurationBlobs []*string + + // The delegation for the Virtual Appliance + Delegation *DelegationProperties + + // Network Virtual Appliance SKU. + NvaSKU *VirtualApplianceSKUProperties + + // The delegation for the Virtual Appliance + PartnerManagedResource *PartnerManagedResourceProperties + + // Public key for SSH login. + SSHPublicKey *string + + // VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. + VirtualApplianceAsn *int64 + + // The Virtual Hub where Network Virtual Appliance is being deployed. + VirtualHub *SubResource + + // READ-ONLY; Address Prefix. + AddressPrefix *string + + // READ-ONLY; The deployment type. PartnerManaged for the SaaS NVA + DeploymentType *string + + // READ-ONLY; List of references to InboundSecurityRules. + InboundSecurityRules []*SubResource + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of Virtual Appliance Network Interfaces. + VirtualApplianceNics []*VirtualApplianceNicProperties + + // READ-ONLY; List of references to VirtualApplianceSite. + VirtualApplianceSites []*SubResource +} + +// VirtualApplianceSKU - Definition of the NetworkVirtualApplianceSkus resource. +type VirtualApplianceSKU struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // NetworkVirtualApplianceSku properties. + Properties *VirtualApplianceSKUPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualApplianceSKUInstances - List of available Sku and instances. +type VirtualApplianceSKUInstances struct { + // READ-ONLY; Instance Count. + InstanceCount *int32 + + // READ-ONLY; Scale Unit. + ScaleUnit *string +} + +// VirtualApplianceSKUListResult - Response for ListNetworkVirtualApplianceSkus API service call. +type VirtualApplianceSKUListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Network Virtual Appliance Skus that are available. + Value []*VirtualApplianceSKU +} + +// VirtualApplianceSKUProperties - Network Virtual Appliance Sku Properties. +type VirtualApplianceSKUProperties struct { + // Virtual Appliance Scale Unit. + BundledScaleUnit *string + + // Virtual Appliance Version. + MarketPlaceVersion *string + + // Virtual Appliance Vendor. + Vendor *string +} + +// VirtualApplianceSKUPropertiesFormat - Properties specific to NetworkVirtualApplianceSkus. +type VirtualApplianceSKUPropertiesFormat struct { + // The list of scale units available. + AvailableScaleUnits []*VirtualApplianceSKUInstances + + // READ-ONLY; Available Network Virtual Appliance versions. + AvailableVersions []*string + + // READ-ONLY; Network Virtual Appliance Sku vendor. + Vendor *string +} + +// VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get method. +type VirtualApplianceSKUsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager +// method. +type VirtualApplianceSKUsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualApplianceSite - Virtual Appliance Site resource. +type VirtualApplianceSite struct { + // Resource ID. + ID *string + + // Name of the virtual appliance site. + Name *string + + // The properties of the Virtual Appliance Sites. + Properties *VirtualApplianceSiteProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Site type. + Type *string +} + +// VirtualApplianceSiteListResult - Response for ListNetworkVirtualApplianceSites API service call. +type VirtualApplianceSiteListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Network Virtual Appliance sites. + Value []*VirtualApplianceSite +} + +// VirtualApplianceSiteProperties - Properties of the rule group. +type VirtualApplianceSiteProperties struct { + // Address Prefix. + AddressPrefix *string + + // Office 365 Policy. + O365Policy *Office365PolicyProperties + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate +// method. +type VirtualApplianceSitesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete +// method. +type VirtualApplianceSitesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualApplianceSitesClientGetOptions contains the optional parameters for the VirtualApplianceSitesClient.Get method. +type VirtualApplianceSitesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.NewListPager +// method. +type VirtualApplianceSitesClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate +// method. +type VirtualAppliancesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete +// method. +type VirtualAppliancesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. +type VirtualAppliancesClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager +// method. +type VirtualAppliancesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager method. +type VirtualAppliancesClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualAppliancesClient.UpdateTags method. +type VirtualAppliancesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VirtualHub Resource. +type VirtualHub struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the virtual hub. + Properties *VirtualHubProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. + Kind *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginCreateOrUpdate +// method. +type VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete +// method. +type VirtualHubBgpConnectionClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubBgpConnectionClientGetOptions contains the optional parameters for the VirtualHubBgpConnectionClient.Get method. +type VirtualHubBgpConnectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes +// method. +type VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes +// method. +type VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.NewListPager +// method. +type VirtualHubBgpConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubEffectiveRoute - The effective route configured on the virtual hub or specified resource. +type VirtualHubEffectiveRoute struct { + // The list of address prefixes. + AddressPrefixes []*string + + // The ASPath of this route. + AsPath *string + + // The type of the next hop. + NextHopType *string + + // The list of next hops. + NextHops []*string + + // The origin of this route. + RouteOrigin *string +} + +// VirtualHubEffectiveRouteList - EffectiveRoutes List. +type VirtualHubEffectiveRouteList struct { + // The list of effective routes configured on the virtual hub or the specified resource. + Value []*VirtualHubEffectiveRoute +} + +// VirtualHubID - Virtual Hub identifier. +type VirtualHubID struct { + // The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and + // the ExpressRoute gateway resource reside in the same subscription. + ID *string +} + +// VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate +// method. +type VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete +// method. +type VirtualHubIPConfigurationClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubIPConfigurationClientGetOptions contains the optional parameters for the VirtualHubIPConfigurationClient.Get +// method. +type VirtualHubIPConfigurationClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.NewListPager +// method. +type VirtualHubIPConfigurationClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubProperties - Parameters for VirtualHub. +type VirtualHubProperties struct { + // Address-prefix for this VirtualHub. + AddressPrefix *string + + // Flag to control transit for VirtualRouter hub. + AllowBranchToBranchTraffic *bool + + // The azureFirewall associated with this VirtualHub. + AzureFirewall *SubResource + + // The expressRouteGateway associated with this VirtualHub. + ExpressRouteGateway *SubResource + + // The hubRoutingPreference of this VirtualHub. + HubRoutingPreference *HubRoutingPreference + + // The P2SVpnGateway associated with this VirtualHub. + P2SVPNGateway *SubResource + + // The preferred gateway to route on-prem traffic + PreferredRoutingGateway *PreferredRoutingGateway + + // The routeTable associated with this virtual hub. + RouteTable *VirtualHubRouteTable + + // The sku of this VirtualHub. + SKU *string + + // The securityPartnerProvider associated with this VirtualHub. + SecurityPartnerProvider *SubResource + + // The Security Provider name. + SecurityProviderName *string + + // The VpnGateway associated with this VirtualHub. + VPNGateway *SubResource + + // List of all virtual hub route table v2s associated with this VirtualHub. + VirtualHubRouteTableV2S []*VirtualHubRouteTableV2 + + // VirtualRouter ASN. + VirtualRouterAsn *int64 + + // The VirtualHub Router autoscale configuration. + VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration + + // VirtualRouter IPs. + VirtualRouterIPs []*string + + // The VirtualWAN to which the VirtualHub belongs. + VirtualWan *SubResource + + // READ-ONLY; List of references to Bgp Connections. + BgpConnections []*SubResource + + // READ-ONLY; List of references to IpConfigurations. + IPConfigurations []*SubResource + + // READ-ONLY; The provisioning state of the virtual hub resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of references to RouteMaps. + RouteMaps []*SubResource + + // READ-ONLY; The routing state. + RoutingState *RoutingState +} + +// VirtualHubRoute - VirtualHub route. +type VirtualHubRoute struct { + // List of all addressPrefixes. + AddressPrefixes []*string + + // NextHop ip address. + NextHopIPAddress *string +} + +// VirtualHubRouteTable - VirtualHub route table. +type VirtualHubRouteTable struct { + // List of all routes. + Routes []*VirtualHubRoute +} + +// VirtualHubRouteTableV2 Resource. +type VirtualHubRouteTableV2 struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the virtual hub route table v2. + Properties *VirtualHubRouteTableV2Properties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VirtualHubRouteTableV2Properties - Parameters for VirtualHubRouteTableV2. +type VirtualHubRouteTableV2Properties struct { + // List of all connections attached to this route table v2. + AttachedConnections []*string + + // List of all routes. + Routes []*VirtualHubRouteV2 + + // READ-ONLY; The provisioning state of the virtual hub route table v2 resource. + ProvisioningState *ProvisioningState +} + +// VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate +// method. +type VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete +// method. +type VirtualHubRouteTableV2SClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubRouteTableV2SClientGetOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.Get method. +type VirtualHubRouteTableV2SClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.NewListPager +// method. +type VirtualHubRouteTableV2SClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubRouteV2 - VirtualHubRouteTableV2 route. +type VirtualHubRouteV2 struct { + // The type of destinations. + DestinationType *string + + // List of all destinations. + Destinations []*string + + // The type of next hops. + NextHopType *string + + // NextHops ip address. + NextHops []*string +} + +// VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate +// method. +type VirtualHubsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. +type VirtualHubsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes +// method. +type VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions struct { + // Parameters supplied to get the effective routes for a specific resource. + EffectiveRoutesParameters *EffectiveRoutesParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubsClientBeginGetInboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetInboundRoutes +// method. +type VirtualHubsClientBeginGetInboundRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubsClientBeginGetOutboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetOutboundRoutes +// method. +type VirtualHubsClientBeginGetOutboundRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. +type VirtualHubsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager +// method. +type VirtualHubsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.NewListPager method. +type VirtualHubsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualHubsClientUpdateTagsOptions contains the optional parameters for the VirtualHubsClient.UpdateTags method. +type VirtualHubsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetwork - Virtual Network resource. +type VirtualNetwork struct { + // The extended location of the virtual network. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the virtual network. + Properties *VirtualNetworkPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkBgpCommunities - Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this +// VNET. +type VirtualNetworkBgpCommunities struct { + // REQUIRED; The BGP community associated with the virtual network. + VirtualNetworkCommunity *string + + // READ-ONLY; The BGP community associated with the region of the virtual network. + RegionalCommunity *string +} + +// VirtualNetworkConnectionGatewayReference - A reference to VirtualNetworkGateway or LocalNetworkGateway resource. +type VirtualNetworkConnectionGatewayReference struct { + // REQUIRED; The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + ID *string +} + +// VirtualNetworkDdosProtectionStatusResult - Response for GetVirtualNetworkDdosProtectionStatusOperation. +type VirtualNetworkDdosProtectionStatusResult struct { + // The URL to get the next set of results. + NextLink *string + + // The Ddos Protection Status Result for each public ip under a virtual network. + Value []*PublicIPDdosProtectionStatusResult +} + +// VirtualNetworkEncryption - Indicates if encryption is enabled on virtual network and if VM without encryption is allowed +// in encrypted VNet. +type VirtualNetworkEncryption struct { + // REQUIRED; Indicates if encryption is enabled on the virtual network. + Enabled *bool + + // If the encrypted VNet allows VM that does not support encryption + Enforcement *VirtualNetworkEncryptionEnforcement +} + +// VirtualNetworkGateway - A common class for general resource information. +type VirtualNetworkGateway struct { + // REQUIRED; Properties of the virtual network gateway. + Properties *VirtualNetworkGatewayPropertiesFormat + + // The extended location of type local virtual network gateway. + ExtendedLocation *ExtendedLocation + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkGatewayConnection - A common class for general resource information. +type VirtualNetworkGatewayConnection struct { + // REQUIRED; Properties of the virtual network gateway connection. + Properties *VirtualNetworkGatewayConnectionPropertiesFormat + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkGatewayConnectionListEntity - A common class for general resource information. +type VirtualNetworkGatewayConnectionListEntity struct { + // REQUIRED; Properties of the virtual network gateway connection. + Properties *VirtualNetworkGatewayConnectionListEntityPropertiesFormat + + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkGatewayConnectionListEntityPropertiesFormat - VirtualNetworkGatewayConnection properties. +type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { + // REQUIRED; Gateway connection type. + ConnectionType *VirtualNetworkGatewayConnectionType + + // REQUIRED; The reference to virtual network gateway resource. + VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference + + // The authorizationKey. + AuthorizationKey *string + + // The connection mode for this connection. + ConnectionMode *VirtualNetworkGatewayConnectionMode + + // Connection protocol used for this connection. + ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol + + // EnableBgp flag. + EnableBgp *bool + + // Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be + // enabled. + EnablePrivateLinkFastPath *bool + + // Bypass ExpressRoute Gateway for data forwarding. + ExpressRouteGatewayBypass *bool + + // GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + GatewayCustomBgpIPAddresses []*GatewayCustomBgpIPAddressIPConfiguration + + // The IPSec Policies to be considered by this connection. + IPSecPolicies []*IPSecPolicy + + // The reference to local network gateway resource. + LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference + + // The reference to peerings resource. + Peer *SubResource + + // The routing weight. + RoutingWeight *int32 + + // The IPSec shared key. + SharedKey *string + + // The Traffic Selector Policies to be considered by this connection. + TrafficSelectorPolicies []*TrafficSelectorPolicy + + // Enable policy-based traffic selectors. + UsePolicyBasedTrafficSelectors *bool + + // The reference to virtual network gateway resource. + VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference + + // READ-ONLY; Virtual Network Gateway connection status. + ConnectionStatus *VirtualNetworkGatewayConnectionStatus + + // READ-ONLY; The egress bytes transferred in this connection. + EgressBytesTransferred *int64 + + // READ-ONLY; The ingress bytes transferred in this connection. + IngressBytesTransferred *int64 + + // READ-ONLY; The provisioning state of the virtual network gateway connection resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the virtual network gateway connection resource. + ResourceGUID *string + + // READ-ONLY; Collection of all tunnels' connection health status. + TunnelConnectionStatus []*TunnelConnectionHealth +} + +// VirtualNetworkGatewayConnectionListResult - Response for the ListVirtualNetworkGatewayConnections API service call. +type VirtualNetworkGatewayConnectionListResult struct { + // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + Value []*VirtualNetworkGatewayConnection + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// VirtualNetworkGatewayConnectionPropertiesFormat - VirtualNetworkGatewayConnection properties. +type VirtualNetworkGatewayConnectionPropertiesFormat struct { + // REQUIRED; Gateway connection type. + ConnectionType *VirtualNetworkGatewayConnectionType + + // REQUIRED; The reference to virtual network gateway resource. + VirtualNetworkGateway1 *VirtualNetworkGateway + + // The authorizationKey. + AuthorizationKey *string + + // The connection mode for this connection. + ConnectionMode *VirtualNetworkGatewayConnectionMode + + // Connection protocol used for this connection. + ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol + + // The dead peer detection timeout of this connection in seconds. + DpdTimeoutSeconds *int32 + + // List of egress NatRules. + EgressNatRules []*SubResource + + // EnableBgp flag. + EnableBgp *bool + + // Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be + // enabled. + EnablePrivateLinkFastPath *bool + + // Bypass ExpressRoute Gateway for data forwarding. + ExpressRouteGatewayBypass *bool + + // GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + GatewayCustomBgpIPAddresses []*GatewayCustomBgpIPAddressIPConfiguration + + // The IPSec Policies to be considered by this connection. + IPSecPolicies []*IPSecPolicy + + // List of ingress NatRules. + IngressNatRules []*SubResource + + // The reference to local network gateway resource. + LocalNetworkGateway2 *LocalNetworkGateway + + // The reference to peerings resource. + Peer *SubResource + + // The routing weight. + RoutingWeight *int32 + + // The IPSec shared key. + SharedKey *string + + // The Traffic Selector Policies to be considered by this connection. + TrafficSelectorPolicies []*TrafficSelectorPolicy + + // Use private local Azure IP for the connection. + UseLocalAzureIPAddress *bool + + // Enable policy-based traffic selectors. + UsePolicyBasedTrafficSelectors *bool + + // The reference to virtual network gateway resource. + VirtualNetworkGateway2 *VirtualNetworkGateway + + // READ-ONLY; Virtual Network Gateway connection status. + ConnectionStatus *VirtualNetworkGatewayConnectionStatus + + // READ-ONLY; The egress bytes transferred in this connection. + EgressBytesTransferred *int64 + + // READ-ONLY; The ingress bytes transferred in this connection. + IngressBytesTransferred *int64 + + // READ-ONLY; The provisioning state of the virtual network gateway connection resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the virtual network gateway connection resource. + ResourceGUID *string + + // READ-ONLY; Collection of all tunnels' connection health status. + TunnelConnectionStatus []*TunnelConnectionHealth +} + +// VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate +// method. +type VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete +// method. +type VirtualNetworkGatewayConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas +// method. +type VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection +// method. +type VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey +// method. +type VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey +// method. +type VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture +// method. +type VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions struct { + // Virtual network gateway packet capture parameters supplied to start packet capture on gateway connection. + Parameters *VPNPacketCaptureStartParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture +// method. +type VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags +// method. +type VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get +// method. +type VirtualNetworkGatewayConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey +// method. +type VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager +// method. +type VirtualNetworkGatewayConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewayIPConfiguration - IP configuration for virtual network gateway. +type VirtualNetworkGatewayIPConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the virtual network gateway ip configuration. + Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of VirtualNetworkGatewayIPConfiguration. +type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { + // The private IP address allocation method. + PrivateIPAllocationMethod *IPAllocationMethod + + // The reference to the public IP resource. + PublicIPAddress *SubResource + + // The reference to the subnet resource. + Subnet *SubResource + + // READ-ONLY; Private IP Address for this gateway. + PrivateIPAddress *string + + // READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. + ProvisioningState *ProvisioningState +} + +// VirtualNetworkGatewayListConnectionsResult - Response for the VirtualNetworkGatewayListConnections API service call. +type VirtualNetworkGatewayListConnectionsResult struct { + // A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + Value []*VirtualNetworkGatewayConnectionListEntity + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// VirtualNetworkGatewayListResult - Response for the ListVirtualNetworkGateways API service call. +type VirtualNetworkGatewayListResult struct { + // A list of VirtualNetworkGateway resources that exists in a resource group. + Value []*VirtualNetworkGateway + + // READ-ONLY; The URL to get the next set of results. + NextLink *string +} + +// VirtualNetworkGatewayNatRule Resource. +type VirtualNetworkGatewayNatRule struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the Virtual Network Gateway NAT rule. + Properties *VirtualNetworkGatewayNatRuleProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkGatewayNatRuleProperties - Parameters for VirtualNetworkGatewayNatRule. +type VirtualNetworkGatewayNatRuleProperties struct { + // The private IP address external mapping for NAT. + ExternalMappings []*VPNNatRuleMapping + + // The IP Configuration ID this NAT rule applies to. + IPConfigurationID *string + + // The private IP address internal mapping for NAT. + InternalMappings []*VPNNatRuleMapping + + // The Source NAT direction of a VPN NAT. + Mode *VPNNatRuleMode + + // The type of NAT rule for VPN NAT. + Type *VPNNatRuleType + + // READ-ONLY; The provisioning state of the NAT Rule resource. + ProvisioningState *ProvisioningState +} + +// VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate +// method. +type VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete +// method. +type VirtualNetworkGatewayNatRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewayNatRulesClientGetOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.Get +// method. +type VirtualNetworkGatewayNatRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager +// method. +type VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewayPolicyGroup - Parameters for VirtualNetworkGatewayPolicyGroup. +type VirtualNetworkGatewayPolicyGroup struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of tVirtualNetworkGatewayPolicyGroup. + Properties *VirtualNetworkGatewayPolicyGroupProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VirtualNetworkGatewayPolicyGroupMember - Vpn Client Connection configuration PolicyGroup member +type VirtualNetworkGatewayPolicyGroupMember struct { + // The Vpn Policy member attribute type. + AttributeType *VPNPolicyMemberAttributeType + + // The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + AttributeValue *string + + // Name of the VirtualNetworkGatewayPolicyGroupMember. + Name *string +} + +// VirtualNetworkGatewayPolicyGroupProperties - Properties of VirtualNetworkGatewayPolicyGroup. +type VirtualNetworkGatewayPolicyGroupProperties struct { + // REQUIRED; Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + IsDefault *bool + + // REQUIRED; Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + PolicyMembers []*VirtualNetworkGatewayPolicyGroupMember + + // REQUIRED; Priority for VirtualNetworkGatewayPolicyGroup. + Priority *int32 + + // READ-ONLY; The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of references to vngClientConnectionConfigurations. + VngClientConnectionConfigurations []*SubResource +} + +// VirtualNetworkGatewayPropertiesFormat - VirtualNetworkGateway properties. +type VirtualNetworkGatewayPropertiesFormat struct { + // ActiveActive flag. + Active *bool + + // Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support connectivity + // to Azure Virtual WAN. + AllowRemoteVnetTraffic *bool + + // Configures this gateway to accept traffic from remote Virtual WAN networks. + AllowVirtualWanTraffic *bool + + // Virtual network gateway's BGP speaker settings. + BgpSettings *BgpSettings + + // The reference to the address space resource which represents the custom routes address space specified by the customer + // for virtual network gateway and VpnClient. + CustomRoutes *AddressSpace + + // disableIPSecReplayProtection flag. + DisableIPSecReplayProtection *bool + + // Whether BGP is enabled for this virtual network gateway or not. + EnableBgp *bool + + // EnableBgpRouteTranslationForNat flag. + EnableBgpRouteTranslationForNat *bool + + // Whether dns forwarding is enabled or not. + EnableDNSForwarding *bool + + // Whether private IP needs to be enabled on this gateway for connections or not. + EnablePrivateIPAddress *bool + + // The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null + // value in case of removing existing default site setting. + GatewayDefaultSite *SubResource + + // The type of this virtual network gateway. + GatewayType *VirtualNetworkGatewayType + + // IP configurations for virtual network gateway. + IPConfigurations []*VirtualNetworkGatewayIPConfiguration + + // NatRules for virtual network gateway. + NatRules []*VirtualNetworkGatewayNatRule + + // The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. + SKU *VirtualNetworkGatewaySKU + + // Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. + VNetExtendedLocationResourceID *string + + // The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + VPNClientConfiguration *VPNClientConfiguration + + // The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + VPNGatewayGeneration *VPNGatewayGeneration + + // The type of this virtual network gateway. + VPNType *VPNType + + // The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available VirtualNetworkGatewayPolicyGroup + // for the gateway. + VirtualNetworkGatewayPolicyGroups []*VirtualNetworkGatewayPolicyGroup + + // READ-ONLY; The IP address allocated by the gateway to which dns requests can be sent. + InboundDNSForwardingEndpoint *string + + // READ-ONLY; The provisioning state of the virtual network gateway resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the virtual network gateway resource. + ResourceGUID *string +} + +// VirtualNetworkGatewaySKU - VirtualNetworkGatewaySku details. +type VirtualNetworkGatewaySKU struct { + // Gateway SKU name. + Name *VirtualNetworkGatewaySKUName + + // Gateway SKU tier. + Tier *VirtualNetworkGatewaySKUTier + + // READ-ONLY; The capacity. + Capacity *int32 +} + +// VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate +// method. +type VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete +// method. +type VirtualNetworkGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters +// for the VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections method. +type VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile +// method. +type VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage +// method. +type VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes +// method. +type VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus +// method. +type VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions struct { + // The IP address of the peer to retrieve the status of. + Peer *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes +// method. +type VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL +// method. +type VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth +// method. +type VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters +// method. +type VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset +// method. +type VirtualNetworkGatewaysClientBeginResetOptions struct { + // Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. + GatewayVip *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey +// method. +type VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters +// method. +type VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture +// method. +type VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions struct { + // Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + Parameters *VPNPacketCaptureStartParameters + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture +// method. +type VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags +// method. +type VirtualNetworkGatewaysClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get method. +type VirtualNetworkGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListConnectionsPager +// method. +type VirtualNetworkGatewaysClientListConnectionsOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager +// method. +type VirtualNetworkGatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices +// method. +type VirtualNetworkGatewaysClientSupportedVPNDevicesOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions contains the optional parameters for the VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript +// method. +type VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkListResult - Response for the ListVirtualNetworks API service call. +type VirtualNetworkListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of VirtualNetwork resources in a resource group. + Value []*VirtualNetwork +} + +// VirtualNetworkListUsageResult - Response for the virtual networks GetUsage API service call. +type VirtualNetworkListUsageResult struct { + // The URL to get the next set of results. + NextLink *string + + // READ-ONLY; VirtualNetwork usage stats. + Value []*VirtualNetworkUsage +} + +// VirtualNetworkPeering - Peerings in a virtual network resource. +type VirtualNetworkPeering struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the virtual network peering. + Properties *VirtualNetworkPeeringPropertiesFormat + + // Resource type. + Type *string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VirtualNetworkPeeringListResult - Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual +// network. +type VirtualNetworkPeeringListResult struct { + // The URL to get the next set of results. + NextLink *string + + // The peerings in a virtual network. + Value []*VirtualNetworkPeering +} + +// VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. +type VirtualNetworkPeeringPropertiesFormat struct { + // Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. + AllowForwardedTraffic *bool + + // If gateway links can be used in remote virtual networking to link to this virtual network. + AllowGatewayTransit *bool + + // Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. + AllowVirtualNetworkAccess *bool + + // If we need to verify the provisioning state of the remote gateway. + DoNotVerifyRemoteGateways *bool + + // The status of the virtual network peering. + PeeringState *VirtualNetworkPeeringState + + // The peering sync status of the virtual network peering. + PeeringSyncLevel *VirtualNetworkPeeringLevel + + // The reference to the address space peered with the remote virtual network. + RemoteAddressSpace *AddressSpace + + // The reference to the remote virtual network's Bgp Communities. + RemoteBgpCommunities *VirtualNetworkBgpCommunities + + // The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). + // See here to register for the preview and learn more + // (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + RemoteVirtualNetwork *SubResource + + // The reference to the current address space of the remote virtual network. + RemoteVirtualNetworkAddressSpace *AddressSpace + + // If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering + // is also true, virtual network will use gateways of remote virtual network + // for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a + // gateway. + UseRemoteGateways *bool + + // READ-ONLY; The provisioning state of the virtual network peering resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The reference to the remote virtual network's encryption + RemoteVirtualNetworkEncryption *VirtualNetworkEncryption + + // READ-ONLY; The resourceGuid property of the Virtual Network peering resource. + ResourceGUID *string +} + +// VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate +// method. +type VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + // Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. + SyncRemoteAddressSpace *SyncRemoteAddressSpace +} + +// VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete +// method. +type VirtualNetworkPeeringsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkPeeringsClientGetOptions contains the optional parameters for the VirtualNetworkPeeringsClient.Get method. +type VirtualNetworkPeeringsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.NewListPager +// method. +type VirtualNetworkPeeringsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkPropertiesFormat - Properties of the virtual network. +type VirtualNetworkPropertiesFormat struct { + // The AddressSpace that contains an array of IP address ranges that can be used by subnets. + AddressSpace *AddressSpace + + // Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + BgpCommunities *VirtualNetworkBgpCommunities + + // The DDoS protection plan associated with the virtual network. + DdosProtectionPlan *SubResource + + // The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + DhcpOptions *DhcpOptions + + // Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection + // plan associated with the resource. + EnableDdosProtection *bool + + // Indicates if VM protection is enabled for all the subnets in the virtual network. + EnableVMProtection *bool + + // Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. + Encryption *VirtualNetworkEncryption + + // The FlowTimeout value (in minutes) for the Virtual Network + FlowTimeoutInMinutes *int32 + + // Array of IpAllocation which reference this VNET. + IPAllocations []*SubResource + + // A list of subnets in a Virtual Network. + Subnets []*Subnet + + // A list of peerings in a Virtual Network. + VirtualNetworkPeerings []*VirtualNetworkPeering + + // READ-ONLY; A collection of references to flow log resources. + FlowLogs []*FlowLog + + // READ-ONLY; The provisioning state of the virtual network resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resourceGuid property of the Virtual Network resource. + ResourceGUID *string +} + +// VirtualNetworkTap - Virtual Network Tap resource. +type VirtualNetworkTap struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Virtual Network Tap Properties. + Properties *VirtualNetworkTapPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualNetworkTapListResult - Response for ListVirtualNetworkTap API service call. +type VirtualNetworkTapListResult struct { + // The URL to get the next set of results. + NextLink *string + + // A list of VirtualNetworkTaps in a resource group. + Value []*VirtualNetworkTap +} + +// VirtualNetworkTapPropertiesFormat - Virtual Network Tap properties. +type VirtualNetworkTapPropertiesFormat struct { + // The reference to the private IP address on the internal Load Balancer that will receive the tap. + DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration + + // The reference to the private IP Address of the collector nic that will receive the tap. + DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration + + // The VXLAN destination port that will receive the tapped traffic. + DestinationPort *int32 + + // READ-ONLY; Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. + NetworkInterfaceTapConfigurations []*InterfaceTapConfiguration + + // READ-ONLY; The provisioning state of the virtual network tap resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The resource GUID property of the virtual network tap resource. + ResourceGUID *string +} + +// VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate +// method. +type VirtualNetworkTapsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete +// method. +type VirtualNetworkTapsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. +type VirtualNetworkTapsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager +// method. +type VirtualNetworkTapsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager +// method. +type VirtualNetworkTapsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkTapsClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkTapsClient.UpdateTags +// method. +type VirtualNetworkTapsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworkUsage - Usage details for subnet. +type VirtualNetworkUsage struct { + // READ-ONLY; Indicates number of IPs used from the Subnet. + CurrentValue *float64 + + // READ-ONLY; Subnet identifier. + ID *string + + // READ-ONLY; Indicates the size of the subnet. + Limit *float64 + + // READ-ONLY; The name containing common and localized value for usage. + Name *VirtualNetworkUsageName + + // READ-ONLY; Usage units. Returns 'Count'. + Unit *string +} + +// VirtualNetworkUsageName - Usage strings container. +type VirtualNetworkUsageName struct { + // READ-ONLY; Localized subnet size and usage string. + LocalizedValue *string + + // READ-ONLY; Subnet size and usage string. + Value *string +} + +// VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate +// method. +type VirtualNetworksClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method. +type VirtualNetworksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus +// method. +type VirtualNetworksClientBeginListDdosProtectionStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + // The skipToken that is given with nextLink. + SkipToken *string + // The max number of ip addresses to return. + Top *int32 +} + +// VirtualNetworksClientCheckIPAddressAvailabilityOptions contains the optional parameters for the VirtualNetworksClient.CheckIPAddressAvailability +// method. +type VirtualNetworksClientCheckIPAddressAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. +type VirtualNetworksClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager method. +type VirtualNetworksClientListAllOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager method. +type VirtualNetworksClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.NewListUsagePager +// method. +type VirtualNetworksClientListUsageOptions struct { + // placeholder for future optional parameters +} + +// VirtualNetworksClientUpdateTagsOptions contains the optional parameters for the VirtualNetworksClient.UpdateTags method. +type VirtualNetworksClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VirtualRouter Resource. +type VirtualRouter struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the Virtual Router. + Properties *VirtualRouterPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualRouterAutoScaleConfiguration - The VirtualHub Router autoscale configuration. +type VirtualRouterAutoScaleConfiguration struct { + // The minimum number of scale units for VirtualHub Router. + MinCapacity *int32 +} + +// VirtualRouterListResult - Response for ListVirtualRouters API service call. +type VirtualRouterListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of Virtual Routers. + Value []*VirtualRouter +} + +// VirtualRouterPeering - Virtual Router Peering resource. +type VirtualRouterPeering struct { + // Resource ID. + ID *string + + // Name of the virtual router peering that is unique within a virtual router. + Name *string + + // The properties of the Virtual Router Peering. + Properties *VirtualRouterPeeringProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Peering type. + Type *string +} + +// VirtualRouterPeeringListResult - Response for ListVirtualRouterPeerings API service call. +type VirtualRouterPeeringListResult struct { + // URL to get the next set of results. + NextLink *string + + // List of VirtualRouterPeerings in a VirtualRouter. + Value []*VirtualRouterPeering +} + +// VirtualRouterPeeringProperties - Properties of the rule group. +type VirtualRouterPeeringProperties struct { + // Peer ASN. + PeerAsn *int64 + + // Peer IP. + PeerIP *string + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate +// method. +type VirtualRouterPeeringsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete +// method. +type VirtualRouterPeeringsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualRouterPeeringsClientGetOptions contains the optional parameters for the VirtualRouterPeeringsClient.Get method. +type VirtualRouterPeeringsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.NewListPager +// method. +type VirtualRouterPeeringsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualRouterPropertiesFormat - Virtual Router definition. +type VirtualRouterPropertiesFormat struct { + // The Gateway on which VirtualRouter is hosted. + HostedGateway *SubResource + + // The Subnet on which VirtualRouter is hosted. + HostedSubnet *SubResource + + // VirtualRouter ASN. + VirtualRouterAsn *int64 + + // VirtualRouter IPs. + VirtualRouterIPs []*string + + // READ-ONLY; List of references to VirtualRouterPeerings. + Peerings []*SubResource + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate +// method. +type VirtualRoutersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete method. +type VirtualRoutersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. +type VirtualRoutersClientGetOptions struct { + // Expands referenced resources. + Expand *string +} + +// VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager +// method. +type VirtualRoutersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.NewListPager method. +type VirtualRoutersClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualWAN Resource. +type VirtualWAN struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the virtual WAN. + Properties *VirtualWanProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// VirtualWanProperties - Parameters for VirtualWAN. +type VirtualWanProperties struct { + // True if branch to branch traffic is allowed. + AllowBranchToBranchTraffic *bool + + // True if Vnet to Vnet traffic is allowed. + AllowVnetToVnetTraffic *bool + + // Vpn encryption to be disabled or not. + DisableVPNEncryption *bool + + // The type of the VirtualWAN. + Type *string + + // READ-ONLY; The office local breakout category. + Office365LocalBreakoutCategory *OfficeTrafficCategory + + // READ-ONLY; The provisioning state of the virtual WAN resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of VpnSites in the VirtualWAN. + VPNSites []*SubResource + + // READ-ONLY; List of VirtualHubs in the VirtualWAN. + VirtualHubs []*SubResource +} + +// VirtualWanSecurityProvider - Collection of SecurityProviders. +type VirtualWanSecurityProvider struct { + // Name of the security provider. + Name *string + + // Url of the security provider. + URL *string + + // READ-ONLY; Name of the security provider. + Type *VirtualWanSecurityProviderType +} + +// VirtualWanSecurityProviders - Collection of SecurityProviders. +type VirtualWanSecurityProviders struct { + // List of VirtualWAN security providers. + SupportedProviders []*VirtualWanSecurityProvider +} + +// VirtualWanVPNProfileParameters - Virtual Wan Vpn profile parameters Vpn profile generation. +type VirtualWanVPNProfileParameters struct { + // VPN client authentication method. + AuthenticationMethod *AuthenticationMethod + + // VpnServerConfiguration partial resource uri with which VirtualWan is associated to. + VPNServerConfigurationResourceID *string +} + +// VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate +// method. +type VirtualWansClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. +type VirtualWansClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. +type VirtualWansClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager +// method. +type VirtualWansClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.NewListPager method. +type VirtualWansClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualWansClientUpdateTagsOptions contains the optional parameters for the VirtualWansClient.UpdateTags method. +type VirtualWansClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// VnetRoute - List of routes that control routing from VirtualHub into a virtual network connection. +type VnetRoute struct { + // List of all Static Routes. + StaticRoutes []*StaticRoute + + // Configuration for static routes on this HubVnetConnection. + StaticRoutesConfig *StaticRoutesConfig + + // READ-ONLY; The list of references to HubBgpConnection objects. + BgpConnections []*SubResource +} + +// VngClientConnectionConfiguration - A vpn client connection configuration for client connection configuration. +type VngClientConnectionConfiguration struct { + // Resource ID. + ID *string + + // The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string + + // Properties of the vpn client root certificate. + Properties *VngClientConnectionConfigurationProperties + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// VngClientConnectionConfigurationProperties - Properties of VngClientConnectionConfiguration. +type VngClientConnectionConfigurationProperties struct { + // REQUIRED; The reference to the address space resource which represents Address space for P2S VpnClient. + VPNClientAddressPool *AddressSpace + + // REQUIRED; List of references to virtualNetworkGatewayPolicyGroups + VirtualNetworkGatewayPolicyGroups []*SubResource + + // READ-ONLY; The provisioning state of the VngClientConnectionConfiguration resource. + ProvisioningState *ProvisioningState +} + +// Watcher - Network watcher in a resource group. +type Watcher struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the network watcher. + Properties *WatcherPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// WatcherListResult - Response for ListNetworkWatchers API service call. +type WatcherListResult struct { + // List of network watcher resources. + Value []*Watcher +} + +// WatcherPropertiesFormat - The network watcher properties. +type WatcherPropertiesFormat struct { + // READ-ONLY; The provisioning state of the network watcher resource. + ProvisioningState *ProvisioningState +} + +// WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity +// method. +type WatchersClientBeginCheckConnectivityOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. +type WatchersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport +// method. +type WatchersClientBeginGetAzureReachabilityReportOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus +// method. +type WatchersClientBeginGetFlowLogStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic +// method. +type WatchersClientBeginGetNetworkConfigurationDiagnosticOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop method. +type WatchersClientBeginGetNextHopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting +// method. +type WatchersClientBeginGetTroubleshootingOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult +// method. +type WatchersClientBeginGetTroubleshootingResultOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules +// method. +type WatchersClientBeginGetVMSecurityRulesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders +// method. +type WatchersClientBeginListAvailableProvidersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration +// method. +type WatchersClientBeginSetFlowLogConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow method. +type WatchersClientBeginVerifyIPFlowOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WatchersClientCreateOrUpdateOptions contains the optional parameters for the WatchersClient.CreateOrUpdate method. +type WatchersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. +type WatchersClientGetOptions struct { + // placeholder for future optional parameters +} + +// WatchersClientGetTopologyOptions contains the optional parameters for the WatchersClient.GetTopology method. +type WatchersClientGetTopologyOptions struct { + // placeholder for future optional parameters +} + +// WatchersClientListAllOptions contains the optional parameters for the WatchersClient.NewListAllPager method. +type WatchersClientListAllOptions struct { + // placeholder for future optional parameters +} + +// WatchersClientListOptions contains the optional parameters for the WatchersClient.NewListPager method. +type WatchersClientListOptions struct { + // placeholder for future optional parameters +} + +// WatchersClientUpdateTagsOptions contains the optional parameters for the WatchersClient.UpdateTags method. +type WatchersClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// WebApplicationFirewallCustomRule - Defines contents of a web application rule. +type WebApplicationFirewallCustomRule struct { + // REQUIRED; Type of Actions. + Action *WebApplicationFirewallAction + + // REQUIRED; List of match conditions. + MatchConditions []*MatchCondition + + // REQUIRED; Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + Priority *int32 + + // REQUIRED; The rule type. + RuleType *WebApplicationFirewallRuleType + + // The name of the resource that is unique within a policy. This name can be used to access the resource. + Name *string + + // Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + State *WebApplicationFirewallState + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string +} + +// WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete +// method. +type WebApplicationFirewallPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WebApplicationFirewallPoliciesClientCreateOrUpdateOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.CreateOrUpdate +// method. +type WebApplicationFirewallPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get +// method. +type WebApplicationFirewallPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager +// method. +type WebApplicationFirewallPoliciesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager +// method. +type WebApplicationFirewallPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// WebApplicationFirewallPolicy - Defines web application firewall policy. +type WebApplicationFirewallPolicy struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the web application firewall policy. + Properties *WebApplicationFirewallPolicyPropertiesFormat + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// WebApplicationFirewallPolicyListResult - Result of the request to list WebApplicationFirewallPolicies. It contains a list +// of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +type WebApplicationFirewallPolicyListResult struct { + // READ-ONLY; URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + NextLink *string + + // READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. + Value []*WebApplicationFirewallPolicy +} + +// WebApplicationFirewallPolicyPropertiesFormat - Defines web application firewall policy properties. +type WebApplicationFirewallPolicyPropertiesFormat struct { + // REQUIRED; Describes the managedRules structure. + ManagedRules *ManagedRulesDefinition + + // The custom rules inside the policy. + CustomRules []*WebApplicationFirewallCustomRule + + // The PolicySettings for policy. + PolicySettings *PolicySettings + + // READ-ONLY; A collection of references to application gateways. + ApplicationGateways []*ApplicationGateway + + // READ-ONLY; A collection of references to application gateway http listeners. + HTTPListeners []*SubResource + + // READ-ONLY; A collection of references to application gateway path rules. + PathBasedRules []*SubResource + + // READ-ONLY; The provisioning state of the web application firewall policy resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; Resource status of the policy. + ResourceState *WebApplicationFirewallPolicyResourceState +} + +// WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. +type WebCategoriesClientGetOptions struct { + // Expands resourceIds back referenced by the azureWebCategory resource. + Expand *string +} + +// WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager +// method. +type WebCategoriesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models_serde.go new file mode 100644 index 00000000000..4c01ad60ed4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/models_serde.go @@ -0,0 +1,33668 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AADAuthenticationParameters. +func (a AADAuthenticationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadAudience", a.AADAudience) + populate(objectMap, "aadIssuer", a.AADIssuer) + populate(objectMap, "aadTenant", a.AADTenant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AADAuthenticationParameters. +func (a *AADAuthenticationParameters) 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 "aadAudience": + err = unpopulate(val, "AADAudience", &a.AADAudience) + delete(rawMsg, key) + case "aadIssuer": + err = unpopulate(val, "AADIssuer", &a.AADIssuer) + delete(rawMsg, key) + case "aadTenant": + err = unpopulate(val, "AADTenant", &a.AADTenant) + 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 Action. +func (a Action) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Action. +func (a *Action) 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 "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + 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 ActiveBaseSecurityAdminRule. +func (a ActiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populate(objectMap, "configurationDescription", a.ConfigurationDescription) + populate(objectMap, "id", a.ID) + objectMap["kind"] = a.Kind + populate(objectMap, "region", a.Region) + populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) + populate(objectMap, "ruleGroups", a.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveBaseSecurityAdminRule. +func (a *ActiveBaseSecurityAdminRule) 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 "commitTime": + err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) + delete(rawMsg, key) + case "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &a.Region) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &a.RuleGroups) + 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 ActiveConfigurationParameter. +func (a ActiveConfigurationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "regions", a.Regions) + populate(objectMap, "skipToken", a.SkipToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConfigurationParameter. +func (a *ActiveConfigurationParameter) 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 "regions": + err = unpopulate(val, "Regions", &a.Regions) + delete(rawMsg, key) + case "skipToken": + err = unpopulate(val, "SkipToken", &a.SkipToken) + 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 ActiveConnectivityConfiguration. +func (a ActiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populate(objectMap, "configurationGroups", a.ConfigurationGroups) + populate(objectMap, "id", a.ID) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "region", a.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConnectivityConfiguration. +func (a *ActiveConnectivityConfiguration) 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 "commitTime": + err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) + delete(rawMsg, key) + case "configurationGroups": + err = unpopulate(val, "ConfigurationGroups", &a.ConfigurationGroups) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &a.Region) + 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 ActiveConnectivityConfigurationsListResult. +func (a ActiveConnectivityConfigurationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", a.SkipToken) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveConnectivityConfigurationsListResult. +func (a *ActiveConnectivityConfigurationsListResult) 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 "skipToken": + err = unpopulate(val, "SkipToken", &a.SkipToken) + 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 ActiveDefaultSecurityAdminRule. +func (a ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populate(objectMap, "configurationDescription", a.ConfigurationDescription) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EffectiveAdminRuleKindDefault + populate(objectMap, "properties", a.Properties) + populate(objectMap, "region", a.Region) + populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) + populate(objectMap, "ruleGroups", a.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDefaultSecurityAdminRule. +func (a *ActiveDefaultSecurityAdminRule) 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 "commitTime": + err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) + delete(rawMsg, key) + case "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &a.Region) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &a.RuleGroups) + 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 ActiveSecurityAdminRule. +func (a ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTime", a.CommitTime) + populate(objectMap, "configurationDescription", a.ConfigurationDescription) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EffectiveAdminRuleKindCustom + populate(objectMap, "properties", a.Properties) + populate(objectMap, "region", a.Region) + populate(objectMap, "ruleCollectionAppliesToGroups", a.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", a.RuleCollectionDescription) + populate(objectMap, "ruleGroups", a.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSecurityAdminRule. +func (a *ActiveSecurityAdminRule) 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 "commitTime": + err = unpopulateTimeRFC3339(val, "CommitTime", &a.CommitTime) + delete(rawMsg, key) + case "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &a.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &a.Region) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &a.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &a.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &a.RuleGroups) + 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 ActiveSecurityAdminRulesListResult. +func (a ActiveSecurityAdminRulesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", a.SkipToken) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSecurityAdminRulesListResult. +func (a *ActiveSecurityAdminRulesListResult) 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 "skipToken": + err = unpopulate(val, "SkipToken", &a.SkipToken) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalActiveBaseSecurityAdminRuleClassificationArray(val) + 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 AddressPrefixItem. +func (a AddressPrefixItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", a.AddressPrefix) + populate(objectMap, "addressPrefixType", a.AddressPrefixType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AddressPrefixItem. +func (a *AddressPrefixItem) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &a.AddressPrefix) + delete(rawMsg, key) + case "addressPrefixType": + err = unpopulate(val, "AddressPrefixType", &a.AddressPrefixType) + 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 AddressSpace. +func (a AddressSpace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", a.AddressPrefixes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AddressSpace. +func (a *AddressSpace) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &a.AddressPrefixes) + 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 AdminPropertiesFormat. +func (a AdminPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", a.Access) + populate(objectMap, "description", a.Description) + populate(objectMap, "destinationPortRanges", a.DestinationPortRanges) + populate(objectMap, "destinations", a.Destinations) + populate(objectMap, "direction", a.Direction) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sourcePortRanges", a.SourcePortRanges) + populate(objectMap, "sources", a.Sources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminPropertiesFormat. +func (a *AdminPropertiesFormat) 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 "access": + err = unpopulate(val, "Access", &a.Access) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &a.DestinationPortRanges) + delete(rawMsg, key) + case "destinations": + err = unpopulate(val, "Destinations", &a.Destinations) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &a.Direction) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &a.SourcePortRanges) + delete(rawMsg, key) + case "sources": + err = unpopulate(val, "Sources", &a.Sources) + 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 AdminRule. +func (a AdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = AdminRuleKindCustom + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRule. +func (a *AdminRule) 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 "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 AdminRuleCollection. +func (a AdminRuleCollection) 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, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleCollection. +func (a *AdminRuleCollection) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + 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 AdminRuleCollectionListResult. +func (a AdminRuleCollectionListResult) 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 AdminRuleCollectionListResult. +func (a *AdminRuleCollectionListResult) 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 AdminRuleCollectionPropertiesFormat. +func (a AdminRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliesToGroups", a.AppliesToGroups) + populate(objectMap, "description", a.Description) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRuleCollectionPropertiesFormat. +func (a *AdminRuleCollectionPropertiesFormat) 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 "appliesToGroups": + err = unpopulate(val, "AppliesToGroups", &a.AppliesToGroups) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 AdminRuleListResult. +func (a AdminRuleListResult) 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 AdminRuleListResult. +func (a *AdminRuleListResult) 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": + a.Value, err = unmarshalBaseAdminRuleClassificationArray(val) + 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 ApplicationGateway. +func (a ApplicationGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + 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 ApplicationGateway. +func (a *ApplicationGateway) 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 "identity": + err = unpopulate(val, "Identity", &a.Identity) + 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayAuthenticationCertificate. +func (a ApplicationGatewayAuthenticationCertificate) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAuthenticationCertificate. +func (a *ApplicationGatewayAuthenticationCertificate) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayAuthenticationCertificatePropertiesFormat. +func (a ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", a.Data) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAuthenticationCertificatePropertiesFormat. +func (a *ApplicationGatewayAuthenticationCertificatePropertiesFormat) 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 "data": + err = unpopulate(val, "Data", &a.Data) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayAutoscaleConfiguration. +func (a ApplicationGatewayAutoscaleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxCapacity", a.MaxCapacity) + populate(objectMap, "minCapacity", a.MinCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAutoscaleConfiguration. +func (a *ApplicationGatewayAutoscaleConfiguration) 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 "maxCapacity": + err = unpopulate(val, "MaxCapacity", &a.MaxCapacity) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &a.MinCapacity) + 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 ApplicationGatewayAvailableSSLOptions. +func (a ApplicationGatewayAvailableSSLOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableSSLOptions. +func (a *ApplicationGatewayAvailableSSLOptions) 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 "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayAvailableSSLOptionsPropertiesFormat. +func (a ApplicationGatewayAvailableSSLOptionsPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availableCipherSuites", a.AvailableCipherSuites) + populate(objectMap, "availableProtocols", a.AvailableProtocols) + populate(objectMap, "defaultPolicy", a.DefaultPolicy) + populate(objectMap, "predefinedPolicies", a.PredefinedPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableSSLOptionsPropertiesFormat. +func (a *ApplicationGatewayAvailableSSLOptionsPropertiesFormat) 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 "availableCipherSuites": + err = unpopulate(val, "AvailableCipherSuites", &a.AvailableCipherSuites) + delete(rawMsg, key) + case "availableProtocols": + err = unpopulate(val, "AvailableProtocols", &a.AvailableProtocols) + delete(rawMsg, key) + case "defaultPolicy": + err = unpopulate(val, "DefaultPolicy", &a.DefaultPolicy) + delete(rawMsg, key) + case "predefinedPolicies": + err = unpopulate(val, "PredefinedPolicies", &a.PredefinedPolicies) + 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 ApplicationGatewayAvailableSSLPredefinedPolicies. +func (a ApplicationGatewayAvailableSSLPredefinedPolicies) 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 ApplicationGatewayAvailableSSLPredefinedPolicies. +func (a *ApplicationGatewayAvailableSSLPredefinedPolicies) 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 ApplicationGatewayAvailableWafRuleSetsResult. +func (a ApplicationGatewayAvailableWafRuleSetsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayAvailableWafRuleSetsResult. +func (a *ApplicationGatewayAvailableWafRuleSetsResult) 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 "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 ApplicationGatewayBackendAddress. +func (a ApplicationGatewayBackendAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", a.Fqdn) + populate(objectMap, "ipAddress", a.IPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddress. +func (a *ApplicationGatewayBackendAddress) 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 "fqdn": + err = unpopulate(val, "Fqdn", &a.Fqdn) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &a.IPAddress) + 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 ApplicationGatewayBackendAddressPool. +func (a ApplicationGatewayBackendAddressPool) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddressPool. +func (a *ApplicationGatewayBackendAddressPool) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayBackendAddressPoolPropertiesFormat. +func (a ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddresses", a.BackendAddresses) + populate(objectMap, "backendIPConfigurations", a.BackendIPConfigurations) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendAddressPoolPropertiesFormat. +func (a *ApplicationGatewayBackendAddressPoolPropertiesFormat) 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 "backendAddresses": + err = unpopulate(val, "BackendAddresses", &a.BackendAddresses) + delete(rawMsg, key) + case "backendIPConfigurations": + err = unpopulate(val, "BackendIPConfigurations", &a.BackendIPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayBackendHTTPSettings. +func (a ApplicationGatewayBackendHTTPSettings) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHTTPSettings. +func (a *ApplicationGatewayBackendHTTPSettings) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayBackendHTTPSettingsPropertiesFormat. +func (a ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affinityCookieName", a.AffinityCookieName) + populate(objectMap, "authenticationCertificates", a.AuthenticationCertificates) + populate(objectMap, "connectionDraining", a.ConnectionDraining) + populate(objectMap, "cookieBasedAffinity", a.CookieBasedAffinity) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "path", a.Path) + populate(objectMap, "pickHostNameFromBackendAddress", a.PickHostNameFromBackendAddress) + populate(objectMap, "port", a.Port) + populate(objectMap, "probe", a.Probe) + populate(objectMap, "probeEnabled", a.ProbeEnabled) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "requestTimeout", a.RequestTimeout) + populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHTTPSettingsPropertiesFormat. +func (a *ApplicationGatewayBackendHTTPSettingsPropertiesFormat) 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 "affinityCookieName": + err = unpopulate(val, "AffinityCookieName", &a.AffinityCookieName) + delete(rawMsg, key) + case "authenticationCertificates": + err = unpopulate(val, "AuthenticationCertificates", &a.AuthenticationCertificates) + delete(rawMsg, key) + case "connectionDraining": + err = unpopulate(val, "ConnectionDraining", &a.ConnectionDraining) + delete(rawMsg, key) + case "cookieBasedAffinity": + err = unpopulate(val, "CookieBasedAffinity", &a.CookieBasedAffinity) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "pickHostNameFromBackendAddress": + err = unpopulate(val, "PickHostNameFromBackendAddress", &a.PickHostNameFromBackendAddress) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "probe": + err = unpopulate(val, "Probe", &a.Probe) + delete(rawMsg, key) + case "probeEnabled": + err = unpopulate(val, "ProbeEnabled", &a.ProbeEnabled) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "requestTimeout": + err = unpopulate(val, "RequestTimeout", &a.RequestTimeout) + delete(rawMsg, key) + case "trustedRootCertificates": + err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) + 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 ApplicationGatewayBackendHealth. +func (a ApplicationGatewayBackendHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPools", a.BackendAddressPools) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealth. +func (a *ApplicationGatewayBackendHealth) 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 "backendAddressPools": + err = unpopulate(val, "BackendAddressPools", &a.BackendAddressPools) + 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 ApplicationGatewayBackendHealthHTTPSettings. +func (a ApplicationGatewayBackendHealthHTTPSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) + populate(objectMap, "servers", a.Servers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthHTTPSettings. +func (a *ApplicationGatewayBackendHealthHTTPSettings) 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 "backendHttpSettings": + err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) + delete(rawMsg, key) + case "servers": + err = unpopulate(val, "Servers", &a.Servers) + 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 ApplicationGatewayBackendHealthOnDemand. +func (a ApplicationGatewayBackendHealthOnDemand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendHealthHttpSettings", a.BackendHealthHTTPSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthOnDemand. +func (a *ApplicationGatewayBackendHealthOnDemand) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendHealthHttpSettings": + err = unpopulate(val, "BackendHealthHTTPSettings", &a.BackendHealthHTTPSettings) + 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 ApplicationGatewayBackendHealthPool. +func (a ApplicationGatewayBackendHealthPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendHttpSettingsCollection", a.BackendHTTPSettingsCollection) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthPool. +func (a *ApplicationGatewayBackendHealthPool) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendHttpSettingsCollection": + err = unpopulate(val, "BackendHTTPSettingsCollection", &a.BackendHTTPSettingsCollection) + 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 ApplicationGatewayBackendHealthServer. +func (a ApplicationGatewayBackendHealthServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", a.Address) + populate(objectMap, "health", a.Health) + populate(objectMap, "healthProbeLog", a.HealthProbeLog) + populate(objectMap, "ipConfiguration", a.IPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendHealthServer. +func (a *ApplicationGatewayBackendHealthServer) 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 "address": + err = unpopulate(val, "Address", &a.Address) + delete(rawMsg, key) + case "health": + err = unpopulate(val, "Health", &a.Health) + delete(rawMsg, key) + case "healthProbeLog": + err = unpopulate(val, "HealthProbeLog", &a.HealthProbeLog) + delete(rawMsg, key) + case "ipConfiguration": + err = unpopulate(val, "IPConfiguration", &a.IPConfiguration) + 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 ApplicationGatewayBackendSettings. +func (a ApplicationGatewayBackendSettings) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendSettings. +func (a *ApplicationGatewayBackendSettings) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayBackendSettingsPropertiesFormat. +func (a ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "pickHostNameFromBackendAddress", a.PickHostNameFromBackendAddress) + populate(objectMap, "port", a.Port) + populate(objectMap, "probe", a.Probe) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "timeout", a.Timeout) + populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayBackendSettingsPropertiesFormat. +func (a *ApplicationGatewayBackendSettingsPropertiesFormat) 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 "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "pickHostNameFromBackendAddress": + err = unpopulate(val, "PickHostNameFromBackendAddress", &a.PickHostNameFromBackendAddress) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "probe": + err = unpopulate(val, "Probe", &a.Probe) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &a.Timeout) + delete(rawMsg, key) + case "trustedRootCertificates": + err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) + 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 ApplicationGatewayClientAuthConfiguration. +func (a ApplicationGatewayClientAuthConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "verifyClientCertIssuerDN", a.VerifyClientCertIssuerDN) + populate(objectMap, "verifyClientRevocation", a.VerifyClientRevocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayClientAuthConfiguration. +func (a *ApplicationGatewayClientAuthConfiguration) 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 "verifyClientCertIssuerDN": + err = unpopulate(val, "VerifyClientCertIssuerDN", &a.VerifyClientCertIssuerDN) + delete(rawMsg, key) + case "verifyClientRevocation": + err = unpopulate(val, "VerifyClientRevocation", &a.VerifyClientRevocation) + 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 ApplicationGatewayConnectionDraining. +func (a ApplicationGatewayConnectionDraining) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "drainTimeoutInSec", a.DrainTimeoutInSec) + populate(objectMap, "enabled", a.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayConnectionDraining. +func (a *ApplicationGatewayConnectionDraining) 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 "drainTimeoutInSec": + err = unpopulate(val, "DrainTimeoutInSec", &a.DrainTimeoutInSec) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + 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 ApplicationGatewayCustomError. +func (a ApplicationGatewayCustomError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customErrorPageUrl", a.CustomErrorPageURL) + populate(objectMap, "statusCode", a.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayCustomError. +func (a *ApplicationGatewayCustomError) 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 "customErrorPageUrl": + err = unpopulate(val, "CustomErrorPageURL", &a.CustomErrorPageURL) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &a.StatusCode) + 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 ApplicationGatewayFirewallDisabledRuleGroup. +func (a ApplicationGatewayFirewallDisabledRuleGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroupName", a.RuleGroupName) + populate(objectMap, "rules", a.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallDisabledRuleGroup. +func (a *ApplicationGatewayFirewallDisabledRuleGroup) 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 "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &a.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &a.Rules) + 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 ApplicationGatewayFirewallExclusion. +func (a ApplicationGatewayFirewallExclusion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchVariable", a.MatchVariable) + populate(objectMap, "selector", a.Selector) + populate(objectMap, "selectorMatchOperator", a.SelectorMatchOperator) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallExclusion. +func (a *ApplicationGatewayFirewallExclusion) 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 "matchVariable": + err = unpopulate(val, "MatchVariable", &a.MatchVariable) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &a.Selector) + delete(rawMsg, key) + case "selectorMatchOperator": + err = unpopulate(val, "SelectorMatchOperator", &a.SelectorMatchOperator) + 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 ApplicationGatewayFirewallManifestRuleSet. +func (a ApplicationGatewayFirewallManifestRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroups", a.RuleGroups) + populate(objectMap, "ruleSetType", a.RuleSetType) + populate(objectMap, "ruleSetVersion", a.RuleSetVersion) + populate(objectMap, "status", a.Status) + populate(objectMap, "tiers", a.Tiers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallManifestRuleSet. +func (a *ApplicationGatewayFirewallManifestRuleSet) 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 "ruleGroups": + err = unpopulate(val, "RuleGroups", &a.RuleGroups) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &a.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &a.RuleSetVersion) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "tiers": + err = unpopulate(val, "Tiers", &a.Tiers) + 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 ApplicationGatewayFirewallRule. +func (a ApplicationGatewayFirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populate(objectMap, "description", a.Description) + populate(objectMap, "ruleId", a.RuleID) + populate(objectMap, "ruleIdString", a.RuleIDString) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRule. +func (a *ApplicationGatewayFirewallRule) 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 "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &a.RuleID) + delete(rawMsg, key) + case "ruleIdString": + err = unpopulate(val, "RuleIDString", &a.RuleIDString) + 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 ApplicationGatewayFirewallRuleGroup. +func (a ApplicationGatewayFirewallRuleGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "ruleGroupName", a.RuleGroupName) + populate(objectMap, "rules", a.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleGroup. +func (a *ApplicationGatewayFirewallRuleGroup) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &a.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &a.Rules) + 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 ApplicationGatewayFirewallRuleSet. +func (a ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleSet. +func (a *ApplicationGatewayFirewallRuleSet) 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 "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGatewayFirewallRuleSetPropertiesFormat. +func (a ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "ruleGroups", a.RuleGroups) + populate(objectMap, "ruleSetType", a.RuleSetType) + populate(objectMap, "ruleSetVersion", a.RuleSetVersion) + populate(objectMap, "tiers", a.Tiers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFirewallRuleSetPropertiesFormat. +func (a *ApplicationGatewayFirewallRuleSetPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &a.RuleGroups) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &a.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &a.RuleSetVersion) + delete(rawMsg, key) + case "tiers": + err = unpopulate(val, "Tiers", &a.Tiers) + 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 ApplicationGatewayFrontendIPConfiguration. +func (a ApplicationGatewayFrontendIPConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendIPConfiguration. +func (a *ApplicationGatewayFrontendIPConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayFrontendIPConfigurationPropertiesFormat. +func (a ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", a.PrivateIPAddress) + populate(objectMap, "privateIPAllocationMethod", a.PrivateIPAllocationMethod) + populate(objectMap, "privateLinkConfiguration", a.PrivateLinkConfiguration) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicIPAddress", a.PublicIPAddress) + populate(objectMap, "subnet", a.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendIPConfigurationPropertiesFormat. +func (a *ApplicationGatewayFrontendIPConfigurationPropertiesFormat) 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 "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &a.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "privateLinkConfiguration": + err = unpopulate(val, "PrivateLinkConfiguration", &a.PrivateLinkConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &a.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &a.Subnet) + 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 ApplicationGatewayFrontendPort. +func (a ApplicationGatewayFrontendPort) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendPort. +func (a *ApplicationGatewayFrontendPort) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayFrontendPortPropertiesFormat. +func (a ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", a.Port) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayFrontendPortPropertiesFormat. +func (a *ApplicationGatewayFrontendPortPropertiesFormat) 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 "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayGlobalConfiguration. +func (a ApplicationGatewayGlobalConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableRequestBuffering", a.EnableRequestBuffering) + populate(objectMap, "enableResponseBuffering", a.EnableResponseBuffering) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayGlobalConfiguration. +func (a *ApplicationGatewayGlobalConfiguration) 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 "enableRequestBuffering": + err = unpopulate(val, "EnableRequestBuffering", &a.EnableRequestBuffering) + delete(rawMsg, key) + case "enableResponseBuffering": + err = unpopulate(val, "EnableResponseBuffering", &a.EnableResponseBuffering) + 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 ApplicationGatewayHTTPListener. +func (a ApplicationGatewayHTTPListener) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHTTPListener. +func (a *ApplicationGatewayHTTPListener) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayHTTPListenerPropertiesFormat. +func (a ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customErrorConfigurations", a.CustomErrorConfigurations) + populate(objectMap, "firewallPolicy", a.FirewallPolicy) + populate(objectMap, "frontendIPConfiguration", a.FrontendIPConfiguration) + populate(objectMap, "frontendPort", a.FrontendPort) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "hostNames", a.HostNames) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "requireServerNameIndication", a.RequireServerNameIndication) + populate(objectMap, "sslCertificate", a.SSLCertificate) + populate(objectMap, "sslProfile", a.SSLProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHTTPListenerPropertiesFormat. +func (a *ApplicationGatewayHTTPListenerPropertiesFormat) 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 "customErrorConfigurations": + err = unpopulate(val, "CustomErrorConfigurations", &a.CustomErrorConfigurations) + delete(rawMsg, key) + case "firewallPolicy": + err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) + delete(rawMsg, key) + case "frontendIPConfiguration": + err = unpopulate(val, "FrontendIPConfiguration", &a.FrontendIPConfiguration) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &a.FrontendPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "hostNames": + err = unpopulate(val, "HostNames", &a.HostNames) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "requireServerNameIndication": + err = unpopulate(val, "RequireServerNameIndication", &a.RequireServerNameIndication) + delete(rawMsg, key) + case "sslCertificate": + err = unpopulate(val, "SSLCertificate", &a.SSLCertificate) + delete(rawMsg, key) + case "sslProfile": + err = unpopulate(val, "SSLProfile", &a.SSLProfile) + 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 ApplicationGatewayHeaderConfiguration. +func (a ApplicationGatewayHeaderConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headerName", a.HeaderName) + populate(objectMap, "headerValue", a.HeaderValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayHeaderConfiguration. +func (a *ApplicationGatewayHeaderConfiguration) 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 "headerName": + err = unpopulate(val, "HeaderName", &a.HeaderName) + delete(rawMsg, key) + case "headerValue": + err = unpopulate(val, "HeaderValue", &a.HeaderValue) + 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 ApplicationGatewayIPConfiguration. +func (a ApplicationGatewayIPConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayIPConfiguration. +func (a *ApplicationGatewayIPConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayIPConfigurationPropertiesFormat. +func (a ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "subnet", a.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayIPConfigurationPropertiesFormat. +func (a *ApplicationGatewayIPConfigurationPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &a.Subnet) + 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 ApplicationGatewayListResult. +func (a ApplicationGatewayListResult) 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 ApplicationGatewayListResult. +func (a *ApplicationGatewayListResult) 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 ApplicationGatewayListener. +func (a ApplicationGatewayListener) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayListener. +func (a *ApplicationGatewayListener) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayListenerPropertiesFormat. +func (a ApplicationGatewayListenerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "frontendIPConfiguration", a.FrontendIPConfiguration) + populate(objectMap, "frontendPort", a.FrontendPort) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sslCertificate", a.SSLCertificate) + populate(objectMap, "sslProfile", a.SSLProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayListenerPropertiesFormat. +func (a *ApplicationGatewayListenerPropertiesFormat) 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 "frontendIPConfiguration": + err = unpopulate(val, "FrontendIPConfiguration", &a.FrontendIPConfiguration) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &a.FrontendPort) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sslCertificate": + err = unpopulate(val, "SSLCertificate", &a.SSLCertificate) + delete(rawMsg, key) + case "sslProfile": + err = unpopulate(val, "SSLProfile", &a.SSLProfile) + 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 ApplicationGatewayLoadDistributionPolicy. +func (a ApplicationGatewayLoadDistributionPolicy) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionPolicy. +func (a *ApplicationGatewayLoadDistributionPolicy) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayLoadDistributionPolicyPropertiesFormat. +func (a ApplicationGatewayLoadDistributionPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "loadDistributionAlgorithm", a.LoadDistributionAlgorithm) + populate(objectMap, "loadDistributionTargets", a.LoadDistributionTargets) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionPolicyPropertiesFormat. +func (a *ApplicationGatewayLoadDistributionPolicyPropertiesFormat) 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 "loadDistributionAlgorithm": + err = unpopulate(val, "LoadDistributionAlgorithm", &a.LoadDistributionAlgorithm) + delete(rawMsg, key) + case "loadDistributionTargets": + err = unpopulate(val, "LoadDistributionTargets", &a.LoadDistributionTargets) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayLoadDistributionTarget. +func (a ApplicationGatewayLoadDistributionTarget) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionTarget. +func (a *ApplicationGatewayLoadDistributionTarget) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayLoadDistributionTargetPropertiesFormat. +func (a ApplicationGatewayLoadDistributionTargetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "weightPerServer", a.WeightPerServer) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayLoadDistributionTargetPropertiesFormat. +func (a *ApplicationGatewayLoadDistributionTargetPropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "weightPerServer": + err = unpopulate(val, "WeightPerServer", &a.WeightPerServer) + 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 ApplicationGatewayOnDemandProbe. +func (a ApplicationGatewayOnDemandProbe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) + populate(objectMap, "host", a.Host) + populate(objectMap, "match", a.Match) + populate(objectMap, "path", a.Path) + populate(objectMap, "pickHostNameFromBackendHttpSettings", a.PickHostNameFromBackendHTTPSettings) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "timeout", a.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayOnDemandProbe. +func (a *ApplicationGatewayOnDemandProbe) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendHttpSettings": + err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &a.Host) + delete(rawMsg, key) + case "match": + err = unpopulate(val, "Match", &a.Match) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "pickHostNameFromBackendHttpSettings": + err = unpopulate(val, "PickHostNameFromBackendHTTPSettings", &a.PickHostNameFromBackendHTTPSettings) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &a.Timeout) + 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 ApplicationGatewayPathRule. +func (a ApplicationGatewayPathRule) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPathRule. +func (a *ApplicationGatewayPathRule) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayPathRulePropertiesFormat. +func (a ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) + populate(objectMap, "firewallPolicy", a.FirewallPolicy) + populate(objectMap, "loadDistributionPolicy", a.LoadDistributionPolicy) + populate(objectMap, "paths", a.Paths) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "redirectConfiguration", a.RedirectConfiguration) + populate(objectMap, "rewriteRuleSet", a.RewriteRuleSet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPathRulePropertiesFormat. +func (a *ApplicationGatewayPathRulePropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendHttpSettings": + err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) + delete(rawMsg, key) + case "firewallPolicy": + err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) + delete(rawMsg, key) + case "loadDistributionPolicy": + err = unpopulate(val, "LoadDistributionPolicy", &a.LoadDistributionPolicy) + delete(rawMsg, key) + case "paths": + err = unpopulate(val, "Paths", &a.Paths) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "redirectConfiguration": + err = unpopulate(val, "RedirectConfiguration", &a.RedirectConfiguration) + delete(rawMsg, key) + case "rewriteRuleSet": + err = unpopulate(val, "RewriteRuleSet", &a.RewriteRuleSet) + 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 ApplicationGatewayPrivateEndpointConnection. +func (a ApplicationGatewayPrivateEndpointConnection) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateEndpointConnection. +func (a *ApplicationGatewayPrivateEndpointConnection) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayPrivateEndpointConnectionListResult. +func (a ApplicationGatewayPrivateEndpointConnectionListResult) 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 ApplicationGatewayPrivateEndpointConnectionListResult. +func (a *ApplicationGatewayPrivateEndpointConnectionListResult) 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 ApplicationGatewayPrivateEndpointConnectionProperties. +func (a ApplicationGatewayPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkIdentifier", a.LinkIdentifier) + populate(objectMap, "privateEndpoint", a.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", a.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateEndpointConnectionProperties. +func (a *ApplicationGatewayPrivateEndpointConnectionProperties) 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 "linkIdentifier": + err = unpopulate(val, "LinkIdentifier", &a.LinkIdentifier) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &a.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &a.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayPrivateLinkConfiguration. +func (a ApplicationGatewayPrivateLinkConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkConfiguration. +func (a *ApplicationGatewayPrivateLinkConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayPrivateLinkConfigurationProperties. +func (a ApplicationGatewayPrivateLinkConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipConfigurations", a.IPConfigurations) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkConfigurationProperties. +func (a *ApplicationGatewayPrivateLinkConfigurationProperties) 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 "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &a.IPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayPrivateLinkIPConfiguration. +func (a ApplicationGatewayPrivateLinkIPConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkIPConfiguration. +func (a *ApplicationGatewayPrivateLinkIPConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayPrivateLinkIPConfigurationProperties. +func (a ApplicationGatewayPrivateLinkIPConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primary", a.Primary) + populate(objectMap, "privateIPAddress", a.PrivateIPAddress) + populate(objectMap, "privateIPAllocationMethod", a.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "subnet", a.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkIPConfigurationProperties. +func (a *ApplicationGatewayPrivateLinkIPConfigurationProperties) 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 "primary": + err = unpopulate(val, "Primary", &a.Primary) + delete(rawMsg, key) + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &a.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &a.Subnet) + 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 ApplicationGatewayPrivateLinkResource. +func (a ApplicationGatewayPrivateLinkResource) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkResource. +func (a *ApplicationGatewayPrivateLinkResource) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayPrivateLinkResourceListResult. +func (a ApplicationGatewayPrivateLinkResourceListResult) 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 ApplicationGatewayPrivateLinkResourceListResult. +func (a *ApplicationGatewayPrivateLinkResourceListResult) 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 ApplicationGatewayPrivateLinkResourceProperties. +func (a ApplicationGatewayPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", a.GroupID) + populate(objectMap, "requiredMembers", a.RequiredMembers) + populate(objectMap, "requiredZoneNames", a.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPrivateLinkResourceProperties. +func (a *ApplicationGatewayPrivateLinkResourceProperties) 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 "groupId": + err = unpopulate(val, "GroupID", &a.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &a.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &a.RequiredZoneNames) + 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 ApplicationGatewayProbe. +func (a ApplicationGatewayProbe) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbe. +func (a *ApplicationGatewayProbe) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayProbeHealthResponseMatch. +func (a ApplicationGatewayProbeHealthResponseMatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "body", a.Body) + populate(objectMap, "statusCodes", a.StatusCodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbeHealthResponseMatch. +func (a *ApplicationGatewayProbeHealthResponseMatch) 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 "body": + err = unpopulate(val, "Body", &a.Body) + delete(rawMsg, key) + case "statusCodes": + err = unpopulate(val, "StatusCodes", &a.StatusCodes) + 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 ApplicationGatewayProbePropertiesFormat. +func (a ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "host", a.Host) + populate(objectMap, "interval", a.Interval) + populate(objectMap, "match", a.Match) + populate(objectMap, "minServers", a.MinServers) + populate(objectMap, "path", a.Path) + populate(objectMap, "pickHostNameFromBackendHttpSettings", a.PickHostNameFromBackendHTTPSettings) + populate(objectMap, "pickHostNameFromBackendSettings", a.PickHostNameFromBackendSettings) + populate(objectMap, "port", a.Port) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "timeout", a.Timeout) + populate(objectMap, "unhealthyThreshold", a.UnhealthyThreshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayProbePropertiesFormat. +func (a *ApplicationGatewayProbePropertiesFormat) 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 "host": + err = unpopulate(val, "Host", &a.Host) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &a.Interval) + delete(rawMsg, key) + case "match": + err = unpopulate(val, "Match", &a.Match) + delete(rawMsg, key) + case "minServers": + err = unpopulate(val, "MinServers", &a.MinServers) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "pickHostNameFromBackendHttpSettings": + err = unpopulate(val, "PickHostNameFromBackendHTTPSettings", &a.PickHostNameFromBackendHTTPSettings) + delete(rawMsg, key) + case "pickHostNameFromBackendSettings": + err = unpopulate(val, "PickHostNameFromBackendSettings", &a.PickHostNameFromBackendSettings) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &a.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &a.Timeout) + delete(rawMsg, key) + case "unhealthyThreshold": + err = unpopulate(val, "UnhealthyThreshold", &a.UnhealthyThreshold) + 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 ApplicationGatewayPropertiesFormat. +func (a ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationCertificates", a.AuthenticationCertificates) + populate(objectMap, "autoscaleConfiguration", a.AutoscaleConfiguration) + populate(objectMap, "backendAddressPools", a.BackendAddressPools) + populate(objectMap, "backendHttpSettingsCollection", a.BackendHTTPSettingsCollection) + populate(objectMap, "backendSettingsCollection", a.BackendSettingsCollection) + populate(objectMap, "customErrorConfigurations", a.CustomErrorConfigurations) + populate(objectMap, "enableFips", a.EnableFips) + populate(objectMap, "enableHttp2", a.EnableHTTP2) + populate(objectMap, "firewallPolicy", a.FirewallPolicy) + populate(objectMap, "forceFirewallPolicyAssociation", a.ForceFirewallPolicyAssociation) + populate(objectMap, "frontendIPConfigurations", a.FrontendIPConfigurations) + populate(objectMap, "frontendPorts", a.FrontendPorts) + populate(objectMap, "gatewayIPConfigurations", a.GatewayIPConfigurations) + populate(objectMap, "globalConfiguration", a.GlobalConfiguration) + populate(objectMap, "httpListeners", a.HTTPListeners) + populate(objectMap, "listeners", a.Listeners) + populate(objectMap, "loadDistributionPolicies", a.LoadDistributionPolicies) + populate(objectMap, "operationalState", a.OperationalState) + populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) + populate(objectMap, "privateLinkConfigurations", a.PrivateLinkConfigurations) + populate(objectMap, "probes", a.Probes) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "redirectConfigurations", a.RedirectConfigurations) + populate(objectMap, "requestRoutingRules", a.RequestRoutingRules) + populate(objectMap, "resourceGuid", a.ResourceGUID) + populate(objectMap, "rewriteRuleSets", a.RewriteRuleSets) + populate(objectMap, "routingRules", a.RoutingRules) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "sslCertificates", a.SSLCertificates) + populate(objectMap, "sslPolicy", a.SSLPolicy) + populate(objectMap, "sslProfiles", a.SSLProfiles) + populate(objectMap, "trustedClientCertificates", a.TrustedClientCertificates) + populate(objectMap, "trustedRootCertificates", a.TrustedRootCertificates) + populate(objectMap, "urlPathMaps", a.URLPathMaps) + populate(objectMap, "webApplicationFirewallConfiguration", a.WebApplicationFirewallConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayPropertiesFormat. +func (a *ApplicationGatewayPropertiesFormat) 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 "authenticationCertificates": + err = unpopulate(val, "AuthenticationCertificates", &a.AuthenticationCertificates) + delete(rawMsg, key) + case "autoscaleConfiguration": + err = unpopulate(val, "AutoscaleConfiguration", &a.AutoscaleConfiguration) + delete(rawMsg, key) + case "backendAddressPools": + err = unpopulate(val, "BackendAddressPools", &a.BackendAddressPools) + delete(rawMsg, key) + case "backendHttpSettingsCollection": + err = unpopulate(val, "BackendHTTPSettingsCollection", &a.BackendHTTPSettingsCollection) + delete(rawMsg, key) + case "backendSettingsCollection": + err = unpopulate(val, "BackendSettingsCollection", &a.BackendSettingsCollection) + delete(rawMsg, key) + case "customErrorConfigurations": + err = unpopulate(val, "CustomErrorConfigurations", &a.CustomErrorConfigurations) + delete(rawMsg, key) + case "enableFips": + err = unpopulate(val, "EnableFips", &a.EnableFips) + delete(rawMsg, key) + case "enableHttp2": + err = unpopulate(val, "EnableHTTP2", &a.EnableHTTP2) + delete(rawMsg, key) + case "firewallPolicy": + err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) + delete(rawMsg, key) + case "forceFirewallPolicyAssociation": + err = unpopulate(val, "ForceFirewallPolicyAssociation", &a.ForceFirewallPolicyAssociation) + delete(rawMsg, key) + case "frontendIPConfigurations": + err = unpopulate(val, "FrontendIPConfigurations", &a.FrontendIPConfigurations) + delete(rawMsg, key) + case "frontendPorts": + err = unpopulate(val, "FrontendPorts", &a.FrontendPorts) + delete(rawMsg, key) + case "gatewayIPConfigurations": + err = unpopulate(val, "GatewayIPConfigurations", &a.GatewayIPConfigurations) + delete(rawMsg, key) + case "globalConfiguration": + err = unpopulate(val, "GlobalConfiguration", &a.GlobalConfiguration) + delete(rawMsg, key) + case "httpListeners": + err = unpopulate(val, "HTTPListeners", &a.HTTPListeners) + delete(rawMsg, key) + case "listeners": + err = unpopulate(val, "Listeners", &a.Listeners) + delete(rawMsg, key) + case "loadDistributionPolicies": + err = unpopulate(val, "LoadDistributionPolicies", &a.LoadDistributionPolicies) + delete(rawMsg, key) + case "operationalState": + err = unpopulate(val, "OperationalState", &a.OperationalState) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections) + delete(rawMsg, key) + case "privateLinkConfigurations": + err = unpopulate(val, "PrivateLinkConfigurations", &a.PrivateLinkConfigurations) + delete(rawMsg, key) + case "probes": + err = unpopulate(val, "Probes", &a.Probes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "redirectConfigurations": + err = unpopulate(val, "RedirectConfigurations", &a.RedirectConfigurations) + delete(rawMsg, key) + case "requestRoutingRules": + err = unpopulate(val, "RequestRoutingRules", &a.RequestRoutingRules) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &a.ResourceGUID) + delete(rawMsg, key) + case "rewriteRuleSets": + err = unpopulate(val, "RewriteRuleSets", &a.RewriteRuleSets) + delete(rawMsg, key) + case "routingRules": + err = unpopulate(val, "RoutingRules", &a.RoutingRules) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "sslCertificates": + err = unpopulate(val, "SSLCertificates", &a.SSLCertificates) + delete(rawMsg, key) + case "sslPolicy": + err = unpopulate(val, "SSLPolicy", &a.SSLPolicy) + delete(rawMsg, key) + case "sslProfiles": + err = unpopulate(val, "SSLProfiles", &a.SSLProfiles) + delete(rawMsg, key) + case "trustedClientCertificates": + err = unpopulate(val, "TrustedClientCertificates", &a.TrustedClientCertificates) + delete(rawMsg, key) + case "trustedRootCertificates": + err = unpopulate(val, "TrustedRootCertificates", &a.TrustedRootCertificates) + delete(rawMsg, key) + case "urlPathMaps": + err = unpopulate(val, "URLPathMaps", &a.URLPathMaps) + delete(rawMsg, key) + case "webApplicationFirewallConfiguration": + err = unpopulate(val, "WebApplicationFirewallConfiguration", &a.WebApplicationFirewallConfiguration) + 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 ApplicationGatewayRedirectConfiguration. +func (a ApplicationGatewayRedirectConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRedirectConfiguration. +func (a *ApplicationGatewayRedirectConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayRedirectConfigurationPropertiesFormat. +func (a ApplicationGatewayRedirectConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "includePath", a.IncludePath) + populate(objectMap, "includeQueryString", a.IncludeQueryString) + populate(objectMap, "pathRules", a.PathRules) + populate(objectMap, "redirectType", a.RedirectType) + populate(objectMap, "requestRoutingRules", a.RequestRoutingRules) + populate(objectMap, "targetListener", a.TargetListener) + populate(objectMap, "targetUrl", a.TargetURL) + populate(objectMap, "urlPathMaps", a.URLPathMaps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRedirectConfigurationPropertiesFormat. +func (a *ApplicationGatewayRedirectConfigurationPropertiesFormat) 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 "includePath": + err = unpopulate(val, "IncludePath", &a.IncludePath) + delete(rawMsg, key) + case "includeQueryString": + err = unpopulate(val, "IncludeQueryString", &a.IncludeQueryString) + delete(rawMsg, key) + case "pathRules": + err = unpopulate(val, "PathRules", &a.PathRules) + delete(rawMsg, key) + case "redirectType": + err = unpopulate(val, "RedirectType", &a.RedirectType) + delete(rawMsg, key) + case "requestRoutingRules": + err = unpopulate(val, "RequestRoutingRules", &a.RequestRoutingRules) + delete(rawMsg, key) + case "targetListener": + err = unpopulate(val, "TargetListener", &a.TargetListener) + delete(rawMsg, key) + case "targetUrl": + err = unpopulate(val, "TargetURL", &a.TargetURL) + delete(rawMsg, key) + case "urlPathMaps": + err = unpopulate(val, "URLPathMaps", &a.URLPathMaps) + 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 ApplicationGatewayRequestRoutingRule. +func (a ApplicationGatewayRequestRoutingRule) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRequestRoutingRule. +func (a *ApplicationGatewayRequestRoutingRule) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayRequestRoutingRulePropertiesFormat. +func (a ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendHttpSettings", a.BackendHTTPSettings) + populate(objectMap, "httpListener", a.HTTPListener) + populate(objectMap, "loadDistributionPolicy", a.LoadDistributionPolicy) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "redirectConfiguration", a.RedirectConfiguration) + populate(objectMap, "rewriteRuleSet", a.RewriteRuleSet) + populate(objectMap, "ruleType", a.RuleType) + populate(objectMap, "urlPathMap", a.URLPathMap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRequestRoutingRulePropertiesFormat. +func (a *ApplicationGatewayRequestRoutingRulePropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendHttpSettings": + err = unpopulate(val, "BackendHTTPSettings", &a.BackendHTTPSettings) + delete(rawMsg, key) + case "httpListener": + err = unpopulate(val, "HTTPListener", &a.HTTPListener) + delete(rawMsg, key) + case "loadDistributionPolicy": + err = unpopulate(val, "LoadDistributionPolicy", &a.LoadDistributionPolicy) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "redirectConfiguration": + err = unpopulate(val, "RedirectConfiguration", &a.RedirectConfiguration) + delete(rawMsg, key) + case "rewriteRuleSet": + err = unpopulate(val, "RewriteRuleSet", &a.RewriteRuleSet) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &a.RuleType) + delete(rawMsg, key) + case "urlPathMap": + err = unpopulate(val, "URLPathMap", &a.URLPathMap) + 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 ApplicationGatewayRewriteRule. +func (a ApplicationGatewayRewriteRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionSet", a.ActionSet) + populate(objectMap, "conditions", a.Conditions) + populate(objectMap, "name", a.Name) + populate(objectMap, "ruleSequence", a.RuleSequence) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRule. +func (a *ApplicationGatewayRewriteRule) 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 "actionSet": + err = unpopulate(val, "ActionSet", &a.ActionSet) + delete(rawMsg, key) + case "conditions": + err = unpopulate(val, "Conditions", &a.Conditions) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "ruleSequence": + err = unpopulate(val, "RuleSequence", &a.RuleSequence) + 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 ApplicationGatewayRewriteRuleActionSet. +func (a ApplicationGatewayRewriteRuleActionSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requestHeaderConfigurations", a.RequestHeaderConfigurations) + populate(objectMap, "responseHeaderConfigurations", a.ResponseHeaderConfigurations) + populate(objectMap, "urlConfiguration", a.URLConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleActionSet. +func (a *ApplicationGatewayRewriteRuleActionSet) 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 "requestHeaderConfigurations": + err = unpopulate(val, "RequestHeaderConfigurations", &a.RequestHeaderConfigurations) + delete(rawMsg, key) + case "responseHeaderConfigurations": + err = unpopulate(val, "ResponseHeaderConfigurations", &a.ResponseHeaderConfigurations) + delete(rawMsg, key) + case "urlConfiguration": + err = unpopulate(val, "URLConfiguration", &a.URLConfiguration) + 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 ApplicationGatewayRewriteRuleCondition. +func (a ApplicationGatewayRewriteRuleCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ignoreCase", a.IgnoreCase) + populate(objectMap, "negate", a.Negate) + populate(objectMap, "pattern", a.Pattern) + populate(objectMap, "variable", a.Variable) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleCondition. +func (a *ApplicationGatewayRewriteRuleCondition) 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 "ignoreCase": + err = unpopulate(val, "IgnoreCase", &a.IgnoreCase) + delete(rawMsg, key) + case "negate": + err = unpopulate(val, "Negate", &a.Negate) + delete(rawMsg, key) + case "pattern": + err = unpopulate(val, "Pattern", &a.Pattern) + delete(rawMsg, key) + case "variable": + err = unpopulate(val, "Variable", &a.Variable) + 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 ApplicationGatewayRewriteRuleSet. +func (a ApplicationGatewayRewriteRuleSet) 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, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleSet. +func (a *ApplicationGatewayRewriteRuleSet) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayRewriteRuleSetPropertiesFormat. +func (a ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "rewriteRules", a.RewriteRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRewriteRuleSetPropertiesFormat. +func (a *ApplicationGatewayRewriteRuleSetPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "rewriteRules": + err = unpopulate(val, "RewriteRules", &a.RewriteRules) + 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 ApplicationGatewayRoutingRule. +func (a ApplicationGatewayRoutingRule) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRoutingRule. +func (a *ApplicationGatewayRoutingRule) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayRoutingRulePropertiesFormat. +func (a ApplicationGatewayRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", a.BackendAddressPool) + populate(objectMap, "backendSettings", a.BackendSettings) + populate(objectMap, "listener", a.Listener) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "ruleType", a.RuleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayRoutingRulePropertiesFormat. +func (a *ApplicationGatewayRoutingRulePropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &a.BackendAddressPool) + delete(rawMsg, key) + case "backendSettings": + err = unpopulate(val, "BackendSettings", &a.BackendSettings) + delete(rawMsg, key) + case "listener": + err = unpopulate(val, "Listener", &a.Listener) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &a.RuleType) + 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 ApplicationGatewaySKU. +func (a ApplicationGatewaySKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", a.Capacity) + populate(objectMap, "name", a.Name) + populate(objectMap, "tier", a.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySKU. +func (a *ApplicationGatewaySKU) 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 "capacity": + err = unpopulate(val, "Capacity", &a.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &a.Tier) + 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 ApplicationGatewaySSLCertificate. +func (a ApplicationGatewaySSLCertificate) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLCertificate. +func (a *ApplicationGatewaySSLCertificate) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewaySSLCertificatePropertiesFormat. +func (a ApplicationGatewaySSLCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", a.Data) + populate(objectMap, "keyVaultSecretId", a.KeyVaultSecretID) + populate(objectMap, "password", a.Password) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicCertData", a.PublicCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLCertificatePropertiesFormat. +func (a *ApplicationGatewaySSLCertificatePropertiesFormat) 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 "data": + err = unpopulate(val, "Data", &a.Data) + delete(rawMsg, key) + case "keyVaultSecretId": + err = unpopulate(val, "KeyVaultSecretID", &a.KeyVaultSecretID) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicCertData": + err = unpopulate(val, "PublicCertData", &a.PublicCertData) + 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 ApplicationGatewaySSLPolicy. +func (a ApplicationGatewaySSLPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cipherSuites", a.CipherSuites) + populate(objectMap, "disabledSslProtocols", a.DisabledSSLProtocols) + populate(objectMap, "minProtocolVersion", a.MinProtocolVersion) + populate(objectMap, "policyName", a.PolicyName) + populate(objectMap, "policyType", a.PolicyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPolicy. +func (a *ApplicationGatewaySSLPolicy) 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 "cipherSuites": + err = unpopulate(val, "CipherSuites", &a.CipherSuites) + delete(rawMsg, key) + case "disabledSslProtocols": + err = unpopulate(val, "DisabledSSLProtocols", &a.DisabledSSLProtocols) + delete(rawMsg, key) + case "minProtocolVersion": + err = unpopulate(val, "MinProtocolVersion", &a.MinProtocolVersion) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &a.PolicyName) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &a.PolicyType) + 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 ApplicationGatewaySSLPredefinedPolicy. +func (a ApplicationGatewaySSLPredefinedPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPredefinedPolicy. +func (a *ApplicationGatewaySSLPredefinedPolicy) 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, "Properties", &a.Properties) + 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 ApplicationGatewaySSLPredefinedPolicyPropertiesFormat. +func (a ApplicationGatewaySSLPredefinedPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cipherSuites", a.CipherSuites) + populate(objectMap, "minProtocolVersion", a.MinProtocolVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLPredefinedPolicyPropertiesFormat. +func (a *ApplicationGatewaySSLPredefinedPolicyPropertiesFormat) 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 "cipherSuites": + err = unpopulate(val, "CipherSuites", &a.CipherSuites) + delete(rawMsg, key) + case "minProtocolVersion": + err = unpopulate(val, "MinProtocolVersion", &a.MinProtocolVersion) + 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 ApplicationGatewaySSLProfile. +func (a ApplicationGatewaySSLProfile) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLProfile. +func (a *ApplicationGatewaySSLProfile) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewaySSLProfilePropertiesFormat. +func (a ApplicationGatewaySSLProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientAuthConfiguration", a.ClientAuthConfiguration) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sslPolicy", a.SSLPolicy) + populate(objectMap, "trustedClientCertificates", a.TrustedClientCertificates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewaySSLProfilePropertiesFormat. +func (a *ApplicationGatewaySSLProfilePropertiesFormat) 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 "clientAuthConfiguration": + err = unpopulate(val, "ClientAuthConfiguration", &a.ClientAuthConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sslPolicy": + err = unpopulate(val, "SSLPolicy", &a.SSLPolicy) + delete(rawMsg, key) + case "trustedClientCertificates": + err = unpopulate(val, "TrustedClientCertificates", &a.TrustedClientCertificates) + 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 ApplicationGatewayTrustedClientCertificate. +func (a ApplicationGatewayTrustedClientCertificate) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedClientCertificate. +func (a *ApplicationGatewayTrustedClientCertificate) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayTrustedClientCertificatePropertiesFormat. +func (a ApplicationGatewayTrustedClientCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientCertIssuerDN", a.ClientCertIssuerDN) + populate(objectMap, "data", a.Data) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "validatedCertData", a.ValidatedCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedClientCertificatePropertiesFormat. +func (a *ApplicationGatewayTrustedClientCertificatePropertiesFormat) 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 "clientCertIssuerDN": + err = unpopulate(val, "ClientCertIssuerDN", &a.ClientCertIssuerDN) + delete(rawMsg, key) + case "data": + err = unpopulate(val, "Data", &a.Data) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "validatedCertData": + err = unpopulate(val, "ValidatedCertData", &a.ValidatedCertData) + 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 ApplicationGatewayTrustedRootCertificate. +func (a ApplicationGatewayTrustedRootCertificate) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedRootCertificate. +func (a *ApplicationGatewayTrustedRootCertificate) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayTrustedRootCertificatePropertiesFormat. +func (a ApplicationGatewayTrustedRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", a.Data) + populate(objectMap, "keyVaultSecretId", a.KeyVaultSecretID) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayTrustedRootCertificatePropertiesFormat. +func (a *ApplicationGatewayTrustedRootCertificatePropertiesFormat) 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 "data": + err = unpopulate(val, "Data", &a.Data) + delete(rawMsg, key) + case "keyVaultSecretId": + err = unpopulate(val, "KeyVaultSecretID", &a.KeyVaultSecretID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayURLConfiguration. +func (a ApplicationGatewayURLConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "modifiedPath", a.ModifiedPath) + populate(objectMap, "modifiedQueryString", a.ModifiedQueryString) + populate(objectMap, "reroute", a.Reroute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLConfiguration. +func (a *ApplicationGatewayURLConfiguration) 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 "modifiedPath": + err = unpopulate(val, "ModifiedPath", &a.ModifiedPath) + delete(rawMsg, key) + case "modifiedQueryString": + err = unpopulate(val, "ModifiedQueryString", &a.ModifiedQueryString) + delete(rawMsg, key) + case "reroute": + err = unpopulate(val, "Reroute", &a.Reroute) + 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 ApplicationGatewayURLPathMap. +func (a ApplicationGatewayURLPathMap) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLPathMap. +func (a *ApplicationGatewayURLPathMap) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplicationGatewayURLPathMapPropertiesFormat. +func (a ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultBackendAddressPool", a.DefaultBackendAddressPool) + populate(objectMap, "defaultBackendHttpSettings", a.DefaultBackendHTTPSettings) + populate(objectMap, "defaultLoadDistributionPolicy", a.DefaultLoadDistributionPolicy) + populate(objectMap, "defaultRedirectConfiguration", a.DefaultRedirectConfiguration) + populate(objectMap, "defaultRewriteRuleSet", a.DefaultRewriteRuleSet) + populate(objectMap, "pathRules", a.PathRules) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayURLPathMapPropertiesFormat. +func (a *ApplicationGatewayURLPathMapPropertiesFormat) 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 "defaultBackendAddressPool": + err = unpopulate(val, "DefaultBackendAddressPool", &a.DefaultBackendAddressPool) + delete(rawMsg, key) + case "defaultBackendHttpSettings": + err = unpopulate(val, "DefaultBackendHTTPSettings", &a.DefaultBackendHTTPSettings) + delete(rawMsg, key) + case "defaultLoadDistributionPolicy": + err = unpopulate(val, "DefaultLoadDistributionPolicy", &a.DefaultLoadDistributionPolicy) + delete(rawMsg, key) + case "defaultRedirectConfiguration": + err = unpopulate(val, "DefaultRedirectConfiguration", &a.DefaultRedirectConfiguration) + delete(rawMsg, key) + case "defaultRewriteRuleSet": + err = unpopulate(val, "DefaultRewriteRuleSet", &a.DefaultRewriteRuleSet) + delete(rawMsg, key) + case "pathRules": + err = unpopulate(val, "PathRules", &a.PathRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 ApplicationGatewayWafDynamicManifestPropertiesResult. +func (a ApplicationGatewayWafDynamicManifestPropertiesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availableRuleSets", a.AvailableRuleSets) + populate(objectMap, "defaultRuleSet", a.DefaultRuleSet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayWafDynamicManifestPropertiesResult. +func (a *ApplicationGatewayWafDynamicManifestPropertiesResult) 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 "availableRuleSets": + err = unpopulate(val, "AvailableRuleSets", &a.AvailableRuleSets) + delete(rawMsg, key) + case "defaultRuleSet": + err = unpopulate(val, "DefaultRuleSet", &a.DefaultRuleSet) + 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 ApplicationGatewayWafDynamicManifestResult. +func (a ApplicationGatewayWafDynamicManifestResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayWafDynamicManifestResult. +func (a *ApplicationGatewayWafDynamicManifestResult) 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, "Properties", &a.Properties) + 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 ApplicationGatewayWafDynamicManifestResultList. +func (a ApplicationGatewayWafDynamicManifestResultList) 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 ApplicationGatewayWafDynamicManifestResultList. +func (a *ApplicationGatewayWafDynamicManifestResultList) 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 ApplicationGatewayWebApplicationFirewallConfiguration. +func (a ApplicationGatewayWebApplicationFirewallConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disabledRuleGroups", a.DisabledRuleGroups) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "exclusions", a.Exclusions) + populate(objectMap, "fileUploadLimitInMb", a.FileUploadLimitInMb) + populate(objectMap, "firewallMode", a.FirewallMode) + populate(objectMap, "maxRequestBodySize", a.MaxRequestBodySize) + populate(objectMap, "maxRequestBodySizeInKb", a.MaxRequestBodySizeInKb) + populate(objectMap, "requestBodyCheck", a.RequestBodyCheck) + populate(objectMap, "ruleSetType", a.RuleSetType) + populate(objectMap, "ruleSetVersion", a.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGatewayWebApplicationFirewallConfiguration. +func (a *ApplicationGatewayWebApplicationFirewallConfiguration) 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 "disabledRuleGroups": + err = unpopulate(val, "DisabledRuleGroups", &a.DisabledRuleGroups) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "exclusions": + err = unpopulate(val, "Exclusions", &a.Exclusions) + delete(rawMsg, key) + case "fileUploadLimitInMb": + err = unpopulate(val, "FileUploadLimitInMb", &a.FileUploadLimitInMb) + delete(rawMsg, key) + case "firewallMode": + err = unpopulate(val, "FirewallMode", &a.FirewallMode) + delete(rawMsg, key) + case "maxRequestBodySize": + err = unpopulate(val, "MaxRequestBodySize", &a.MaxRequestBodySize) + delete(rawMsg, key) + case "maxRequestBodySizeInKb": + err = unpopulate(val, "MaxRequestBodySizeInKb", &a.MaxRequestBodySizeInKb) + delete(rawMsg, key) + case "requestBodyCheck": + err = unpopulate(val, "RequestBodyCheck", &a.RequestBodyCheck) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &a.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &a.RuleSetVersion) + 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 ApplicationRule. +func (a ApplicationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "destinationAddresses", a.DestinationAddresses) + populate(objectMap, "fqdnTags", a.FqdnTags) + populate(objectMap, "name", a.Name) + populate(objectMap, "protocols", a.Protocols) + objectMap["ruleType"] = FirewallPolicyRuleTypeApplicationRule + populate(objectMap, "sourceAddresses", a.SourceAddresses) + populate(objectMap, "sourceIpGroups", a.SourceIPGroups) + populate(objectMap, "targetFqdns", a.TargetFqdns) + populate(objectMap, "targetUrls", a.TargetUrls) + populate(objectMap, "terminateTLS", a.TerminateTLS) + populate(objectMap, "webCategories", a.WebCategories) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationRule. +func (a *ApplicationRule) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) + delete(rawMsg, key) + case "fqdnTags": + err = unpopulate(val, "FqdnTags", &a.FqdnTags) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &a.RuleType) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) + delete(rawMsg, key) + case "targetFqdns": + err = unpopulate(val, "TargetFqdns", &a.TargetFqdns) + delete(rawMsg, key) + case "targetUrls": + err = unpopulate(val, "TargetUrls", &a.TargetUrls) + delete(rawMsg, key) + case "terminateTLS": + err = unpopulate(val, "TerminateTLS", &a.TerminateTLS) + delete(rawMsg, key) + case "webCategories": + err = unpopulate(val, "WebCategories", &a.WebCategories) + 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 ApplicationSecurityGroup. +func (a ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationSecurityGroup. +func (a *ApplicationSecurityGroup) 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 "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationSecurityGroupListResult. +func (a ApplicationSecurityGroupListResult) 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 ApplicationSecurityGroupListResult. +func (a *ApplicationSecurityGroupListResult) 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 ApplicationSecurityGroupPropertiesFormat. +func (a ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "resourceGuid", a.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationSecurityGroupPropertiesFormat. +func (a *ApplicationSecurityGroupPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &a.ResourceGUID) + 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 AuthorizationListResult. +func (a AuthorizationListResult) 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 AuthorizationListResult. +func (a *AuthorizationListResult) 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 AuthorizationPropertiesFormat. +func (a AuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationKey", a.AuthorizationKey) + populate(objectMap, "authorizationUseStatus", a.AuthorizationUseStatus) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationPropertiesFormat. +func (a *AuthorizationPropertiesFormat) 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 "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &a.AuthorizationKey) + delete(rawMsg, key) + case "authorizationUseStatus": + err = unpopulate(val, "AuthorizationUseStatus", &a.AuthorizationUseStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 AutoApprovedPrivateLinkService. +func (a AutoApprovedPrivateLinkService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkService", a.PrivateLinkService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoApprovedPrivateLinkService. +func (a *AutoApprovedPrivateLinkService) 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 "privateLinkService": + err = unpopulate(val, "PrivateLinkService", &a.PrivateLinkService) + 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 AutoApprovedPrivateLinkServicesResult. +func (a AutoApprovedPrivateLinkServicesResult) 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 AutoApprovedPrivateLinkServicesResult. +func (a *AutoApprovedPrivateLinkServicesResult) 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 Availability. +func (a Availability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", a.BlobDuration) + populate(objectMap, "retention", a.Retention) + populate(objectMap, "timeGrain", a.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Availability. +func (a *Availability) 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 "blobDuration": + err = unpopulate(val, "BlobDuration", &a.BlobDuration) + delete(rawMsg, key) + case "retention": + err = unpopulate(val, "Retention", &a.Retention) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &a.TimeGrain) + 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 AvailableDelegation. +func (a AvailableDelegation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actions", a.Actions) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "serviceName", a.ServiceName) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableDelegation. +func (a *AvailableDelegation) 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 "actions": + err = unpopulate(val, "Actions", &a.Actions) + 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 "serviceName": + err = unpopulate(val, "ServiceName", &a.ServiceName) + 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 AvailableDelegationsResult. +func (a AvailableDelegationsResult) 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 AvailableDelegationsResult. +func (a *AvailableDelegationsResult) 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 AvailablePrivateEndpointType. +func (a AvailablePrivateEndpointType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "resourceName", a.ResourceName) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePrivateEndpointType. +func (a *AvailablePrivateEndpointType) 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 "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + 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 "resourceName": + err = unpopulate(val, "ResourceName", &a.ResourceName) + 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 AvailablePrivateEndpointTypesResult. +func (a AvailablePrivateEndpointTypesResult) 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 AvailablePrivateEndpointTypesResult. +func (a *AvailablePrivateEndpointTypesResult) 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 AvailableProvidersList. +func (a AvailableProvidersList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "countries", a.Countries) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersList. +func (a *AvailableProvidersList) 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 "countries": + err = unpopulate(val, "Countries", &a.Countries) + 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 AvailableProvidersListCity. +func (a AvailableProvidersListCity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cityName", a.CityName) + populate(objectMap, "providers", a.Providers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListCity. +func (a *AvailableProvidersListCity) 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 "cityName": + err = unpopulate(val, "CityName", &a.CityName) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &a.Providers) + 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 AvailableProvidersListCountry. +func (a AvailableProvidersListCountry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "countryName", a.CountryName) + populate(objectMap, "providers", a.Providers) + populate(objectMap, "states", a.States) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListCountry. +func (a *AvailableProvidersListCountry) 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 "countryName": + err = unpopulate(val, "CountryName", &a.CountryName) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &a.Providers) + delete(rawMsg, key) + case "states": + err = unpopulate(val, "States", &a.States) + 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 AvailableProvidersListParameters. +func (a AvailableProvidersListParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureLocations", a.AzureLocations) + populate(objectMap, "city", a.City) + populate(objectMap, "country", a.Country) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListParameters. +func (a *AvailableProvidersListParameters) 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 "azureLocations": + err = unpopulate(val, "AzureLocations", &a.AzureLocations) + delete(rawMsg, key) + case "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &a.Country) + 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 AvailableProvidersListState. +func (a AvailableProvidersListState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cities", a.Cities) + populate(objectMap, "providers", a.Providers) + populate(objectMap, "stateName", a.StateName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableProvidersListState. +func (a *AvailableProvidersListState) 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 "cities": + err = unpopulate(val, "Cities", &a.Cities) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &a.Providers) + delete(rawMsg, key) + case "stateName": + err = unpopulate(val, "StateName", &a.StateName) + 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 AvailableServiceAlias. +func (a AvailableServiceAlias) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "resourceName", a.ResourceName) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceAlias. +func (a *AvailableServiceAlias) 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 "resourceName": + err = unpopulate(val, "ResourceName", &a.ResourceName) + 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 AvailableServiceAliasesResult. +func (a AvailableServiceAliasesResult) 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 AvailableServiceAliasesResult. +func (a *AvailableServiceAliasesResult) 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 AzureAsyncOperationResult. +func (a AzureAsyncOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", a.Error) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureAsyncOperationResult. +func (a *AzureAsyncOperationResult) 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 "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + 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 AzureFirewall. +func (a AzureFirewall) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + 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 AzureFirewall. +func (a *AzureFirewall) 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 "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureFirewallApplicationRule. +func (a AzureFirewallApplicationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "fqdnTags", a.FqdnTags) + populate(objectMap, "name", a.Name) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "sourceAddresses", a.SourceAddresses) + populate(objectMap, "sourceIpGroups", a.SourceIPGroups) + populate(objectMap, "targetFqdns", a.TargetFqdns) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRule. +func (a *AzureFirewallApplicationRule) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "fqdnTags": + err = unpopulate(val, "FqdnTags", &a.FqdnTags) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) + delete(rawMsg, key) + case "targetFqdns": + err = unpopulate(val, "TargetFqdns", &a.TargetFqdns) + 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 AzureFirewallApplicationRuleCollection. +func (a AzureFirewallApplicationRuleCollection) 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, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleCollection. +func (a *AzureFirewallApplicationRuleCollection) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureFirewallApplicationRuleCollectionPropertiesFormat. +func (a AzureFirewallApplicationRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "rules", a.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleCollectionPropertiesFormat. +func (a *AzureFirewallApplicationRuleCollectionPropertiesFormat) 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 "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &a.Rules) + 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 AzureFirewallApplicationRuleProtocol. +func (a AzureFirewallApplicationRuleProtocol) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", a.Port) + populate(objectMap, "protocolType", a.ProtocolType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallApplicationRuleProtocol. +func (a *AzureFirewallApplicationRuleProtocol) 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 "port": + err = unpopulate(val, "Port", &a.Port) + delete(rawMsg, key) + case "protocolType": + err = unpopulate(val, "ProtocolType", &a.ProtocolType) + 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 AzureFirewallFqdnTag. +func (a AzureFirewallFqdnTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallFqdnTag. +func (a *AzureFirewallFqdnTag) 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 "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureFirewallFqdnTagListResult. +func (a AzureFirewallFqdnTagListResult) 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 AzureFirewallFqdnTagListResult. +func (a *AzureFirewallFqdnTagListResult) 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 AzureFirewallFqdnTagPropertiesFormat. +func (a AzureFirewallFqdnTagPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdnTagName", a.FqdnTagName) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallFqdnTagPropertiesFormat. +func (a *AzureFirewallFqdnTagPropertiesFormat) 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 "fqdnTagName": + err = unpopulate(val, "FqdnTagName", &a.FqdnTagName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 AzureFirewallIPConfiguration. +func (a AzureFirewallIPConfiguration) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPConfiguration. +func (a *AzureFirewallIPConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureFirewallIPConfigurationPropertiesFormat. +func (a AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", a.PrivateIPAddress) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicIPAddress", a.PublicIPAddress) + populate(objectMap, "subnet", a.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPConfigurationPropertiesFormat. +func (a *AzureFirewallIPConfigurationPropertiesFormat) 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 "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &a.PrivateIPAddress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &a.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &a.Subnet) + 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 AzureFirewallIPGroups. +func (a AzureFirewallIPGroups) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "changeNumber", a.ChangeNumber) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallIPGroups. +func (a *AzureFirewallIPGroups) 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 "changeNumber": + err = unpopulate(val, "ChangeNumber", &a.ChangeNumber) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + 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 AzureFirewallListResult. +func (a AzureFirewallListResult) 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 AzureFirewallListResult. +func (a *AzureFirewallListResult) 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 AzureFirewallNatRCAction. +func (a AzureFirewallNatRCAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRCAction. +func (a *AzureFirewallNatRCAction) 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 "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 AzureFirewallNatRule. +func (a AzureFirewallNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "destinationAddresses", a.DestinationAddresses) + populate(objectMap, "destinationPorts", a.DestinationPorts) + populate(objectMap, "name", a.Name) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "sourceAddresses", a.SourceAddresses) + populate(objectMap, "sourceIpGroups", a.SourceIPGroups) + populate(objectMap, "translatedAddress", a.TranslatedAddress) + populate(objectMap, "translatedFqdn", a.TranslatedFqdn) + populate(objectMap, "translatedPort", a.TranslatedPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRule. +func (a *AzureFirewallNatRule) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &a.DestinationPorts) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) + delete(rawMsg, key) + case "translatedAddress": + err = unpopulate(val, "TranslatedAddress", &a.TranslatedAddress) + delete(rawMsg, key) + case "translatedFqdn": + err = unpopulate(val, "TranslatedFqdn", &a.TranslatedFqdn) + delete(rawMsg, key) + case "translatedPort": + err = unpopulate(val, "TranslatedPort", &a.TranslatedPort) + 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 AzureFirewallNatRuleCollection. +func (a AzureFirewallNatRuleCollection) 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, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRuleCollection. +func (a *AzureFirewallNatRuleCollection) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureFirewallNatRuleCollectionProperties. +func (a AzureFirewallNatRuleCollectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "rules", a.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNatRuleCollectionProperties. +func (a *AzureFirewallNatRuleCollectionProperties) 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 "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &a.Rules) + 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 AzureFirewallNetworkRule. +func (a AzureFirewallNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "destinationAddresses", a.DestinationAddresses) + populate(objectMap, "destinationFqdns", a.DestinationFqdns) + populate(objectMap, "destinationIpGroups", a.DestinationIPGroups) + populate(objectMap, "destinationPorts", a.DestinationPorts) + populate(objectMap, "name", a.Name) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "sourceAddresses", a.SourceAddresses) + populate(objectMap, "sourceIpGroups", a.SourceIPGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRule. +func (a *AzureFirewallNetworkRule) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &a.DestinationAddresses) + delete(rawMsg, key) + case "destinationFqdns": + err = unpopulate(val, "DestinationFqdns", &a.DestinationFqdns) + delete(rawMsg, key) + case "destinationIpGroups": + err = unpopulate(val, "DestinationIPGroups", &a.DestinationIPGroups) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &a.DestinationPorts) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &a.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &a.SourceIPGroups) + 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 AzureFirewallNetworkRuleCollection. +func (a AzureFirewallNetworkRuleCollection) 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, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRuleCollection. +func (a *AzureFirewallNetworkRuleCollection) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureFirewallNetworkRuleCollectionPropertiesFormat. +func (a AzureFirewallNetworkRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", a.Action) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "rules", a.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallNetworkRuleCollectionPropertiesFormat. +func (a *AzureFirewallNetworkRuleCollectionPropertiesFormat) 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 "action": + err = unpopulate(val, "Action", &a.Action) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &a.Rules) + 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 AzureFirewallPropertiesFormat. +func (a AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalProperties", a.AdditionalProperties) + populate(objectMap, "applicationRuleCollections", a.ApplicationRuleCollections) + populate(objectMap, "firewallPolicy", a.FirewallPolicy) + populate(objectMap, "hubIPAddresses", a.HubIPAddresses) + populate(objectMap, "ipConfigurations", a.IPConfigurations) + populate(objectMap, "ipGroups", a.IPGroups) + populate(objectMap, "managementIpConfiguration", a.ManagementIPConfiguration) + populate(objectMap, "natRuleCollections", a.NatRuleCollections) + populate(objectMap, "networkRuleCollections", a.NetworkRuleCollections) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "threatIntelMode", a.ThreatIntelMode) + populate(objectMap, "virtualHub", a.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallPropertiesFormat. +func (a *AzureFirewallPropertiesFormat) 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 "additionalProperties": + err = unpopulate(val, "AdditionalProperties", &a.AdditionalProperties) + delete(rawMsg, key) + case "applicationRuleCollections": + err = unpopulate(val, "ApplicationRuleCollections", &a.ApplicationRuleCollections) + delete(rawMsg, key) + case "firewallPolicy": + err = unpopulate(val, "FirewallPolicy", &a.FirewallPolicy) + delete(rawMsg, key) + case "hubIPAddresses": + err = unpopulate(val, "HubIPAddresses", &a.HubIPAddresses) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &a.IPConfigurations) + delete(rawMsg, key) + case "ipGroups": + err = unpopulate(val, "IPGroups", &a.IPGroups) + delete(rawMsg, key) + case "managementIpConfiguration": + err = unpopulate(val, "ManagementIPConfiguration", &a.ManagementIPConfiguration) + delete(rawMsg, key) + case "natRuleCollections": + err = unpopulate(val, "NatRuleCollections", &a.NatRuleCollections) + delete(rawMsg, key) + case "networkRuleCollections": + err = unpopulate(val, "NetworkRuleCollections", &a.NetworkRuleCollections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "threatIntelMode": + err = unpopulate(val, "ThreatIntelMode", &a.ThreatIntelMode) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &a.VirtualHub) + 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 AzureFirewallPublicIPAddress. +func (a AzureFirewallPublicIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", a.Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallPublicIPAddress. +func (a *AzureFirewallPublicIPAddress) 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 "address": + err = unpopulate(val, "Address", &a.Address) + 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 AzureFirewallRCAction. +func (a AzureFirewallRCAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallRCAction. +func (a *AzureFirewallRCAction) 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 "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 AzureFirewallSKU. +func (a AzureFirewallSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", a.Name) + populate(objectMap, "tier", a.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirewallSKU. +func (a *AzureFirewallSKU) 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 "tier": + err = unpopulate(val, "Tier", &a.Tier) + 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 AzureReachabilityReport. +func (a AzureReachabilityReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationLevel", a.AggregationLevel) + populate(objectMap, "providerLocation", a.ProviderLocation) + populate(objectMap, "reachabilityReport", a.ReachabilityReport) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReport. +func (a *AzureReachabilityReport) 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 "aggregationLevel": + err = unpopulate(val, "AggregationLevel", &a.AggregationLevel) + delete(rawMsg, key) + case "providerLocation": + err = unpopulate(val, "ProviderLocation", &a.ProviderLocation) + delete(rawMsg, key) + case "reachabilityReport": + err = unpopulate(val, "ReachabilityReport", &a.ReachabilityReport) + 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 AzureReachabilityReportItem. +func (a AzureReachabilityReportItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureLocation", a.AzureLocation) + populate(objectMap, "latencies", a.Latencies) + populate(objectMap, "provider", a.Provider) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportItem. +func (a *AzureReachabilityReportItem) 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 "azureLocation": + err = unpopulate(val, "AzureLocation", &a.AzureLocation) + delete(rawMsg, key) + case "latencies": + err = unpopulate(val, "Latencies", &a.Latencies) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &a.Provider) + 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 AzureReachabilityReportLatencyInfo. +func (a AzureReachabilityReportLatencyInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "score", a.Score) + populateTimeRFC3339(objectMap, "timeStamp", a.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportLatencyInfo. +func (a *AzureReachabilityReportLatencyInfo) 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 "score": + err = unpopulate(val, "Score", &a.Score) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, "TimeStamp", &a.TimeStamp) + 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 AzureReachabilityReportLocation. +func (a AzureReachabilityReportLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "city", a.City) + populate(objectMap, "country", a.Country) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportLocation. +func (a *AzureReachabilityReportLocation) 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 "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &a.Country) + 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 AzureReachabilityReportParameters. +func (a AzureReachabilityReportParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureLocations", a.AzureLocations) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "providerLocation", a.ProviderLocation) + populate(objectMap, "providers", a.Providers) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureReachabilityReportParameters. +func (a *AzureReachabilityReportParameters) 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 "azureLocations": + err = unpopulate(val, "AzureLocations", &a.AzureLocations) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) + delete(rawMsg, key) + case "providerLocation": + err = unpopulate(val, "ProviderLocation", &a.ProviderLocation) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &a.Providers) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(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 AzureWebCategory. +func (a AzureWebCategory) 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, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWebCategory. +func (a *AzureWebCategory) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AzureWebCategoryListResult. +func (a AzureWebCategoryListResult) 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 AzureWebCategoryListResult. +func (a *AzureWebCategoryListResult) 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 AzureWebCategoryPropertiesFormat. +func (a AzureWebCategoryPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "group", a.Group) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWebCategoryPropertiesFormat. +func (a *AzureWebCategoryPropertiesFormat) 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 "group": + err = unpopulate(val, "Group", &a.Group) + 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 BGPCommunity. +func (b BGPCommunity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "communityName", b.CommunityName) + populate(objectMap, "communityPrefixes", b.CommunityPrefixes) + populate(objectMap, "communityValue", b.CommunityValue) + populate(objectMap, "isAuthorizedToUse", b.IsAuthorizedToUse) + populate(objectMap, "serviceGroup", b.ServiceGroup) + populate(objectMap, "serviceSupportedRegion", b.ServiceSupportedRegion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BGPCommunity. +func (b *BGPCommunity) 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 "communityName": + err = unpopulate(val, "CommunityName", &b.CommunityName) + delete(rawMsg, key) + case "communityPrefixes": + err = unpopulate(val, "CommunityPrefixes", &b.CommunityPrefixes) + delete(rawMsg, key) + case "communityValue": + err = unpopulate(val, "CommunityValue", &b.CommunityValue) + delete(rawMsg, key) + case "isAuthorizedToUse": + err = unpopulate(val, "IsAuthorizedToUse", &b.IsAuthorizedToUse) + delete(rawMsg, key) + case "serviceGroup": + err = unpopulate(val, "ServiceGroup", &b.ServiceGroup) + delete(rawMsg, key) + case "serviceSupportedRegion": + err = unpopulate(val, "ServiceSupportedRegion", &b.ServiceSupportedRegion) + 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 BackendAddressInboundNatRulePortMappings. +func (b BackendAddressInboundNatRulePortMappings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inboundNatRulePortMappings", b.InboundNatRulePortMappings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressInboundNatRulePortMappings. +func (b *BackendAddressInboundNatRulePortMappings) 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 "inboundNatRulePortMappings": + err = unpopulate(val, "InboundNatRulePortMappings", &b.InboundNatRulePortMappings) + 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 BackendAddressPool. +func (b BackendAddressPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressPool. +func (b *BackendAddressPool) 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 "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 "properties": + err = unpopulate(val, "Properties", &b.Properties) + 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 BackendAddressPoolPropertiesFormat. +func (b BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendIPConfigurations", b.BackendIPConfigurations) + populate(objectMap, "drainPeriodInSeconds", b.DrainPeriodInSeconds) + populate(objectMap, "inboundNatRules", b.InboundNatRules) + populate(objectMap, "loadBalancerBackendAddresses", b.LoadBalancerBackendAddresses) + populate(objectMap, "loadBalancingRules", b.LoadBalancingRules) + populate(objectMap, "location", b.Location) + populate(objectMap, "outboundRule", b.OutboundRule) + populate(objectMap, "outboundRules", b.OutboundRules) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "tunnelInterfaces", b.TunnelInterfaces) + populate(objectMap, "virtualNetwork", b.VirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAddressPoolPropertiesFormat. +func (b *BackendAddressPoolPropertiesFormat) 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 "backendIPConfigurations": + err = unpopulate(val, "BackendIPConfigurations", &b.BackendIPConfigurations) + delete(rawMsg, key) + case "drainPeriodInSeconds": + err = unpopulate(val, "DrainPeriodInSeconds", &b.DrainPeriodInSeconds) + delete(rawMsg, key) + case "inboundNatRules": + err = unpopulate(val, "InboundNatRules", &b.InboundNatRules) + delete(rawMsg, key) + case "loadBalancerBackendAddresses": + err = unpopulate(val, "LoadBalancerBackendAddresses", &b.LoadBalancerBackendAddresses) + delete(rawMsg, key) + case "loadBalancingRules": + err = unpopulate(val, "LoadBalancingRules", &b.LoadBalancingRules) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + delete(rawMsg, key) + case "outboundRule": + err = unpopulate(val, "OutboundRule", &b.OutboundRule) + delete(rawMsg, key) + case "outboundRules": + err = unpopulate(val, "OutboundRules", &b.OutboundRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "tunnelInterfaces": + err = unpopulate(val, "TunnelInterfaces", &b.TunnelInterfaces) + delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &b.VirtualNetwork) + 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 BaseAdminRule. +func (b BaseAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + objectMap["kind"] = b.Kind + populate(objectMap, "name", b.Name) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseAdminRule. +func (b *BaseAdminRule) 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 "etag": + err = unpopulate(val, "Etag", &b.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &b.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + 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 BastionActiveSession. +func (b BastionActiveSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "protocol", b.Protocol) + populate(objectMap, "resourceType", b.ResourceType) + populate(objectMap, "sessionDurationInMins", b.SessionDurationInMins) + populate(objectMap, "sessionId", b.SessionID) + populateAny(objectMap, "startTime", b.StartTime) + populate(objectMap, "targetHostName", b.TargetHostName) + populate(objectMap, "targetIpAddress", b.TargetIPAddress) + populate(objectMap, "targetResourceGroup", b.TargetResourceGroup) + populate(objectMap, "targetResourceId", b.TargetResourceID) + populate(objectMap, "targetSubscriptionId", b.TargetSubscriptionID) + populate(objectMap, "userName", b.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionActiveSession. +func (b *BastionActiveSession) 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 "protocol": + err = unpopulate(val, "Protocol", &b.Protocol) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &b.ResourceType) + delete(rawMsg, key) + case "sessionDurationInMins": + err = unpopulate(val, "SessionDurationInMins", &b.SessionDurationInMins) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &b.SessionID) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &b.StartTime) + delete(rawMsg, key) + case "targetHostName": + err = unpopulate(val, "TargetHostName", &b.TargetHostName) + delete(rawMsg, key) + case "targetIpAddress": + err = unpopulate(val, "TargetIPAddress", &b.TargetIPAddress) + delete(rawMsg, key) + case "targetResourceGroup": + err = unpopulate(val, "TargetResourceGroup", &b.TargetResourceGroup) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &b.TargetResourceID) + delete(rawMsg, key) + case "targetSubscriptionId": + err = unpopulate(val, "TargetSubscriptionID", &b.TargetSubscriptionID) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &b.UserName) + 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 BastionActiveSessionListResult. +func (b BastionActiveSessionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionActiveSessionListResult. +func (b *BastionActiveSessionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, 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 BastionHost. +func (b BastionHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "sku", b.SKU) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHost. +func (b *BastionHost) 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 "etag": + err = unpopulate(val, "Etag", &b.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + 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 "sku": + err = unpopulate(val, "SKU", &b.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + 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 BastionHostIPConfiguration. +func (b BastionHostIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostIPConfiguration. +func (b *BastionHostIPConfiguration) 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 "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 "properties": + err = unpopulate(val, "Properties", &b.Properties) + 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 BastionHostIPConfigurationPropertiesFormat. +func (b BastionHostIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAllocationMethod", b.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "publicIPAddress", b.PublicIPAddress) + populate(objectMap, "subnet", b.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostIPConfigurationPropertiesFormat. +func (b *BastionHostIPConfigurationPropertiesFormat) 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 "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &b.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &b.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &b.Subnet) + 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 BastionHostListResult. +func (b BastionHostListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostListResult. +func (b *BastionHostListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, 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 BastionHostPropertiesFormat. +func (b BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsName", b.DNSName) + populate(objectMap, "disableCopyPaste", b.DisableCopyPaste) + populate(objectMap, "enableFileCopy", b.EnableFileCopy) + populate(objectMap, "enableIpConnect", b.EnableIPConnect) + populate(objectMap, "enableShareableLink", b.EnableShareableLink) + populate(objectMap, "enableTunneling", b.EnableTunneling) + populate(objectMap, "ipConfigurations", b.IPConfigurations) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "scaleUnits", b.ScaleUnits) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionHostPropertiesFormat. +func (b *BastionHostPropertiesFormat) 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 "dnsName": + err = unpopulate(val, "DNSName", &b.DNSName) + delete(rawMsg, key) + case "disableCopyPaste": + err = unpopulate(val, "DisableCopyPaste", &b.DisableCopyPaste) + delete(rawMsg, key) + case "enableFileCopy": + err = unpopulate(val, "EnableFileCopy", &b.EnableFileCopy) + delete(rawMsg, key) + case "enableIpConnect": + err = unpopulate(val, "EnableIPConnect", &b.EnableIPConnect) + delete(rawMsg, key) + case "enableShareableLink": + err = unpopulate(val, "EnableShareableLink", &b.EnableShareableLink) + delete(rawMsg, key) + case "enableTunneling": + err = unpopulate(val, "EnableTunneling", &b.EnableTunneling) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &b.IPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "scaleUnits": + err = unpopulate(val, "ScaleUnits", &b.ScaleUnits) + 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 BastionSessionDeleteResult. +func (b BastionSessionDeleteResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionSessionDeleteResult. +func (b *BastionSessionDeleteResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, 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 BastionSessionState. +func (b BastionSessionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", b.Message) + populate(objectMap, "sessionId", b.SessionID) + populate(objectMap, "state", b.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionSessionState. +func (b *BastionSessionState) 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 "message": + err = unpopulate(val, "Message", &b.Message) + delete(rawMsg, key) + case "sessionId": + err = unpopulate(val, "SessionID", &b.SessionID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &b.State) + 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 BastionShareableLink. +func (b BastionShareableLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bsl", b.Bsl) + populate(objectMap, "createdAt", b.CreatedAt) + populate(objectMap, "message", b.Message) + populate(objectMap, "vm", b.VM) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLink. +func (b *BastionShareableLink) 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 "bsl": + err = unpopulate(val, "Bsl", &b.Bsl) + delete(rawMsg, key) + case "createdAt": + err = unpopulate(val, "CreatedAt", &b.CreatedAt) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &b.Message) + delete(rawMsg, key) + case "vm": + err = unpopulate(val, "VM", &b.VM) + 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 BastionShareableLinkListRequest. +func (b BastionShareableLinkListRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "vms", b.VMs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLinkListRequest. +func (b *BastionShareableLinkListRequest) 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 "vms": + err = unpopulate(val, "VMs", &b.VMs) + 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 BastionShareableLinkListResult. +func (b BastionShareableLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BastionShareableLinkListResult. +func (b *BastionShareableLinkListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, 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 BgpConnection. +func (b BgpConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpConnection. +func (b *BgpConnection) 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 "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 "properties": + err = unpopulate(val, "Properties", &b.Properties) + 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 BgpConnectionProperties. +func (b BgpConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionState", b.ConnectionState) + populate(objectMap, "hubVirtualNetworkConnection", b.HubVirtualNetworkConnection) + populate(objectMap, "peerAsn", b.PeerAsn) + populate(objectMap, "peerIp", b.PeerIP) + populate(objectMap, "provisioningState", b.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpConnectionProperties. +func (b *BgpConnectionProperties) 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 "connectionState": + err = unpopulate(val, "ConnectionState", &b.ConnectionState) + delete(rawMsg, key) + case "hubVirtualNetworkConnection": + err = unpopulate(val, "HubVirtualNetworkConnection", &b.HubVirtualNetworkConnection) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &b.PeerAsn) + delete(rawMsg, key) + case "peerIp": + err = unpopulate(val, "PeerIP", &b.PeerIP) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + 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 BgpPeerStatus. +func (b BgpPeerStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asn", b.Asn) + populate(objectMap, "connectedDuration", b.ConnectedDuration) + populate(objectMap, "localAddress", b.LocalAddress) + populate(objectMap, "messagesReceived", b.MessagesReceived) + populate(objectMap, "messagesSent", b.MessagesSent) + populate(objectMap, "neighbor", b.Neighbor) + populate(objectMap, "routesReceived", b.RoutesReceived) + populate(objectMap, "state", b.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpPeerStatus. +func (b *BgpPeerStatus) 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 "asn": + err = unpopulate(val, "Asn", &b.Asn) + delete(rawMsg, key) + case "connectedDuration": + err = unpopulate(val, "ConnectedDuration", &b.ConnectedDuration) + delete(rawMsg, key) + case "localAddress": + err = unpopulate(val, "LocalAddress", &b.LocalAddress) + delete(rawMsg, key) + case "messagesReceived": + err = unpopulate(val, "MessagesReceived", &b.MessagesReceived) + delete(rawMsg, key) + case "messagesSent": + err = unpopulate(val, "MessagesSent", &b.MessagesSent) + delete(rawMsg, key) + case "neighbor": + err = unpopulate(val, "Neighbor", &b.Neighbor) + delete(rawMsg, key) + case "routesReceived": + err = unpopulate(val, "RoutesReceived", &b.RoutesReceived) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &b.State) + 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 BgpPeerStatusListResult. +func (b BgpPeerStatusListResult) 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 BgpPeerStatusListResult. +func (b *BgpPeerStatusListResult) 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 BgpServiceCommunity. +func (b BgpServiceCommunity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunity. +func (b *BgpServiceCommunity) 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 "location": + err = unpopulate(val, "Location", &b.Location) + 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 "tags": + err = unpopulate(val, "Tags", &b.Tags) + 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 BgpServiceCommunityListResult. +func (b BgpServiceCommunityListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunityListResult. +func (b *BgpServiceCommunityListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, 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 BgpServiceCommunityPropertiesFormat. +func (b BgpServiceCommunityPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpCommunities", b.BgpCommunities) + populate(objectMap, "serviceName", b.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceCommunityPropertiesFormat. +func (b *BgpServiceCommunityPropertiesFormat) 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 "bgpCommunities": + err = unpopulate(val, "BgpCommunities", &b.BgpCommunities) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &b.ServiceName) + 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 BgpSettings. +func (b BgpSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asn", b.Asn) + populate(objectMap, "bgpPeeringAddress", b.BgpPeeringAddress) + populate(objectMap, "bgpPeeringAddresses", b.BgpPeeringAddresses) + populate(objectMap, "peerWeight", b.PeerWeight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpSettings. +func (b *BgpSettings) 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 "asn": + err = unpopulate(val, "Asn", &b.Asn) + delete(rawMsg, key) + case "bgpPeeringAddress": + err = unpopulate(val, "BgpPeeringAddress", &b.BgpPeeringAddress) + delete(rawMsg, key) + case "bgpPeeringAddresses": + err = unpopulate(val, "BgpPeeringAddresses", &b.BgpPeeringAddresses) + delete(rawMsg, key) + case "peerWeight": + err = unpopulate(val, "PeerWeight", &b.PeerWeight) + 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 BreakOutCategoryPolicies. +func (b BreakOutCategoryPolicies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allow", b.Allow) + populate(objectMap, "default", b.Default) + populate(objectMap, "optimize", b.Optimize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BreakOutCategoryPolicies. +func (b *BreakOutCategoryPolicies) 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 "allow": + err = unpopulate(val, "Allow", &b.Allow) + delete(rawMsg, key) + case "default": + err = unpopulate(val, "Default", &b.Default) + delete(rawMsg, key) + case "optimize": + err = unpopulate(val, "Optimize", &b.Optimize) + 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 CheckPrivateLinkServiceVisibilityRequest. +func (c CheckPrivateLinkServiceVisibilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkServiceAlias", c.PrivateLinkServiceAlias) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckPrivateLinkServiceVisibilityRequest. +func (c *CheckPrivateLinkServiceVisibilityRequest) 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 "privateLinkServiceAlias": + err = unpopulate(val, "PrivateLinkServiceAlias", &c.PrivateLinkServiceAlias) + 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 ChildResource. +func (c ChildResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ChildResource. +func (c *ChildResource) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", c.ClientID) + populate(objectMap, "principalId", c.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) 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 "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &c.PrincipalID) + 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 ConfigurationDiagnosticParameters. +func (c ConfigurationDiagnosticParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "profiles", c.Profiles) + populate(objectMap, "targetResourceId", c.TargetResourceID) + populate(objectMap, "verbosityLevel", c.VerbosityLevel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticParameters. +func (c *ConfigurationDiagnosticParameters) 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 "profiles": + err = unpopulate(val, "Profiles", &c.Profiles) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &c.TargetResourceID) + delete(rawMsg, key) + case "verbosityLevel": + err = unpopulate(val, "VerbosityLevel", &c.VerbosityLevel) + 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 ConfigurationDiagnosticProfile. +func (c ConfigurationDiagnosticProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "destinationPort", c.DestinationPort) + populate(objectMap, "direction", c.Direction) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "source", c.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticProfile. +func (c *ConfigurationDiagnosticProfile) 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 "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "destinationPort": + err = unpopulate(val, "DestinationPort", &c.DestinationPort) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &c.Direction) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + 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 ConfigurationDiagnosticResponse. +func (c ConfigurationDiagnosticResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "results", c.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticResponse. +func (c *ConfigurationDiagnosticResponse) 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 "results": + err = unpopulate(val, "Results", &c.Results) + 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 ConfigurationDiagnosticResult. +func (c ConfigurationDiagnosticResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSecurityGroupResult", c.NetworkSecurityGroupResult) + populate(objectMap, "profile", c.Profile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationDiagnosticResult. +func (c *ConfigurationDiagnosticResult) 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 "networkSecurityGroupResult": + err = unpopulate(val, "NetworkSecurityGroupResult", &c.NetworkSecurityGroupResult) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &c.Profile) + 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 ConfigurationGroup. +func (c ConfigurationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationGroup. +func (c *ConfigurationGroup) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + 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 ConnectionMonitor. +func (c ConnectionMonitor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", c.Location) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitor. +func (c *ConnectionMonitor) 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 "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 ConnectionMonitorDestination. +func (c ConnectionMonitorDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "port", c.Port) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorDestination. +func (c *ConnectionMonitorDestination) 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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ConnectionMonitorEndpoint. +func (c ConnectionMonitorEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "coverageLevel", c.CoverageLevel) + populate(objectMap, "filter", c.Filter) + populate(objectMap, "name", c.Name) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "scope", c.Scope) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpoint. +func (c *ConnectionMonitorEndpoint) 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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "coverageLevel": + err = unpopulate(val, "CoverageLevel", &c.CoverageLevel) + delete(rawMsg, key) + case "filter": + err = unpopulate(val, "Filter", &c.Filter) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &c.Scope) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectionMonitorEndpointFilter. +func (c ConnectionMonitorEndpointFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "items", c.Items) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointFilter. +func (c *ConnectionMonitorEndpointFilter) 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 "items": + err = unpopulate(val, "Items", &c.Items) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectionMonitorEndpointFilterItem. +func (c ConnectionMonitorEndpointFilterItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointFilterItem. +func (c *ConnectionMonitorEndpointFilterItem) 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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectionMonitorEndpointScope. +func (c ConnectionMonitorEndpointScope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclude", c.Exclude) + populate(objectMap, "include", c.Include) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointScope. +func (c *ConnectionMonitorEndpointScope) 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 "exclude": + err = unpopulate(val, "Exclude", &c.Exclude) + delete(rawMsg, key) + case "include": + err = unpopulate(val, "Include", &c.Include) + 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 ConnectionMonitorEndpointScopeItem. +func (c ConnectionMonitorEndpointScopeItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorEndpointScopeItem. +func (c *ConnectionMonitorEndpointScopeItem) 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 "address": + err = unpopulate(val, "Address", &c.Address) + 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 ConnectionMonitorHTTPConfiguration. +func (c ConnectionMonitorHTTPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "method", c.Method) + populate(objectMap, "path", c.Path) + populate(objectMap, "port", c.Port) + populate(objectMap, "preferHTTPS", c.PreferHTTPS) + populate(objectMap, "requestHeaders", c.RequestHeaders) + populate(objectMap, "validStatusCodeRanges", c.ValidStatusCodeRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorHTTPConfiguration. +func (c *ConnectionMonitorHTTPConfiguration) 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 "method": + err = unpopulate(val, "Method", &c.Method) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &c.Path) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "preferHTTPS": + err = unpopulate(val, "PreferHTTPS", &c.PreferHTTPS) + delete(rawMsg, key) + case "requestHeaders": + err = unpopulate(val, "RequestHeaders", &c.RequestHeaders) + delete(rawMsg, key) + case "validStatusCodeRanges": + err = unpopulate(val, "ValidStatusCodeRanges", &c.ValidStatusCodeRanges) + 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 ConnectionMonitorIcmpConfiguration. +func (c ConnectionMonitorIcmpConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableTraceRoute", c.DisableTraceRoute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorIcmpConfiguration. +func (c *ConnectionMonitorIcmpConfiguration) 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 "disableTraceRoute": + err = unpopulate(val, "DisableTraceRoute", &c.DisableTraceRoute) + 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 ConnectionMonitorListResult. +func (c ConnectionMonitorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorListResult. +func (c *ConnectionMonitorListResult) 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 "value": + err = unpopulate(val, "Value", &c.Value) + 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 ConnectionMonitorOutput. +func (c ConnectionMonitorOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", c.Type) + populate(objectMap, "workspaceSettings", c.WorkspaceSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorOutput. +func (c *ConnectionMonitorOutput) 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 "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "workspaceSettings": + err = unpopulate(val, "WorkspaceSettings", &c.WorkspaceSettings) + 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 ConnectionMonitorParameters. +func (c ConnectionMonitorParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoStart", c.AutoStart) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "endpoints", c.Endpoints) + populate(objectMap, "monitoringIntervalInSeconds", c.MonitoringIntervalInSeconds) + populate(objectMap, "notes", c.Notes) + populate(objectMap, "outputs", c.Outputs) + populate(objectMap, "source", c.Source) + populate(objectMap, "testConfigurations", c.TestConfigurations) + populate(objectMap, "testGroups", c.TestGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorParameters. +func (c *ConnectionMonitorParameters) 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 "autoStart": + err = unpopulate(val, "AutoStart", &c.AutoStart) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &c.Endpoints) + delete(rawMsg, key) + case "monitoringIntervalInSeconds": + err = unpopulate(val, "MonitoringIntervalInSeconds", &c.MonitoringIntervalInSeconds) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &c.Notes) + delete(rawMsg, key) + case "outputs": + err = unpopulate(val, "Outputs", &c.Outputs) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + case "testConfigurations": + err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) + delete(rawMsg, key) + case "testGroups": + err = unpopulate(val, "TestGroups", &c.TestGroups) + 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 ConnectionMonitorQueryResult. +func (c ConnectionMonitorQueryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceStatus", c.SourceStatus) + populate(objectMap, "states", c.States) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorQueryResult. +func (c *ConnectionMonitorQueryResult) 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 "sourceStatus": + err = unpopulate(val, "SourceStatus", &c.SourceStatus) + delete(rawMsg, key) + case "states": + err = unpopulate(val, "States", &c.States) + 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 ConnectionMonitorResult. +func (c ConnectionMonitorResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorResult. +func (c *ConnectionMonitorResult) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectionMonitorResultProperties. +func (c ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoStart", c.AutoStart) + populate(objectMap, "connectionMonitorType", c.ConnectionMonitorType) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "endpoints", c.Endpoints) + populate(objectMap, "monitoringIntervalInSeconds", c.MonitoringIntervalInSeconds) + populate(objectMap, "monitoringStatus", c.MonitoringStatus) + populate(objectMap, "notes", c.Notes) + populate(objectMap, "outputs", c.Outputs) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "source", c.Source) + populateTimeRFC3339(objectMap, "startTime", c.StartTime) + populate(objectMap, "testConfigurations", c.TestConfigurations) + populate(objectMap, "testGroups", c.TestGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorResultProperties. +func (c *ConnectionMonitorResultProperties) 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 "autoStart": + err = unpopulate(val, "AutoStart", &c.AutoStart) + delete(rawMsg, key) + case "connectionMonitorType": + err = unpopulate(val, "ConnectionMonitorType", &c.ConnectionMonitorType) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &c.Endpoints) + delete(rawMsg, key) + case "monitoringIntervalInSeconds": + err = unpopulate(val, "MonitoringIntervalInSeconds", &c.MonitoringIntervalInSeconds) + delete(rawMsg, key) + case "monitoringStatus": + err = unpopulate(val, "MonitoringStatus", &c.MonitoringStatus) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &c.Notes) + delete(rawMsg, key) + case "outputs": + err = unpopulate(val, "Outputs", &c.Outputs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + case "testConfigurations": + err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) + delete(rawMsg, key) + case "testGroups": + err = unpopulate(val, "TestGroups", &c.TestGroups) + 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 ConnectionMonitorSource. +func (c ConnectionMonitorSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", c.Port) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorSource. +func (c *ConnectionMonitorSource) 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 "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ConnectionMonitorSuccessThreshold. +func (c ConnectionMonitorSuccessThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "checksFailedPercent", c.ChecksFailedPercent) + populate(objectMap, "roundTripTimeMs", c.RoundTripTimeMs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorSuccessThreshold. +func (c *ConnectionMonitorSuccessThreshold) 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 "checksFailedPercent": + err = unpopulate(val, "ChecksFailedPercent", &c.ChecksFailedPercent) + delete(rawMsg, key) + case "roundTripTimeMs": + err = unpopulate(val, "RoundTripTimeMs", &c.RoundTripTimeMs) + 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 ConnectionMonitorTCPConfiguration. +func (c ConnectionMonitorTCPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationPortBehavior", c.DestinationPortBehavior) + populate(objectMap, "disableTraceRoute", c.DisableTraceRoute) + populate(objectMap, "port", c.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTCPConfiguration. +func (c *ConnectionMonitorTCPConfiguration) 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 "destinationPortBehavior": + err = unpopulate(val, "DestinationPortBehavior", &c.DestinationPortBehavior) + delete(rawMsg, key) + case "disableTraceRoute": + err = unpopulate(val, "DisableTraceRoute", &c.DisableTraceRoute) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + 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 ConnectionMonitorTestConfiguration. +func (c ConnectionMonitorTestConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "httpConfiguration", c.HTTPConfiguration) + populate(objectMap, "icmpConfiguration", c.IcmpConfiguration) + populate(objectMap, "name", c.Name) + populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "successThreshold", c.SuccessThreshold) + populate(objectMap, "tcpConfiguration", c.TCPConfiguration) + populate(objectMap, "testFrequencySec", c.TestFrequencySec) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestConfiguration. +func (c *ConnectionMonitorTestConfiguration) 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 "httpConfiguration": + err = unpopulate(val, "HTTPConfiguration", &c.HTTPConfiguration) + delete(rawMsg, key) + case "icmpConfiguration": + err = unpopulate(val, "IcmpConfiguration", &c.IcmpConfiguration) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "preferredIPVersion": + err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) + delete(rawMsg, key) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &c.SuccessThreshold) + delete(rawMsg, key) + case "tcpConfiguration": + err = unpopulate(val, "TCPConfiguration", &c.TCPConfiguration) + delete(rawMsg, key) + case "testFrequencySec": + err = unpopulate(val, "TestFrequencySec", &c.TestFrequencySec) + 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 ConnectionMonitorTestGroup. +func (c ConnectionMonitorTestGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinations", c.Destinations) + populate(objectMap, "disable", c.Disable) + populate(objectMap, "name", c.Name) + populate(objectMap, "sources", c.Sources) + populate(objectMap, "testConfigurations", c.TestConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorTestGroup. +func (c *ConnectionMonitorTestGroup) 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 "destinations": + err = unpopulate(val, "Destinations", &c.Destinations) + delete(rawMsg, key) + case "disable": + err = unpopulate(val, "Disable", &c.Disable) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "sources": + err = unpopulate(val, "Sources", &c.Sources) + delete(rawMsg, key) + case "testConfigurations": + err = unpopulate(val, "TestConfigurations", &c.TestConfigurations) + 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 ConnectionMonitorWorkspaceSettings. +func (c ConnectionMonitorWorkspaceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "workspaceResourceId", c.WorkspaceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionMonitorWorkspaceSettings. +func (c *ConnectionMonitorWorkspaceSettings) 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 "workspaceResourceId": + err = unpopulate(val, "WorkspaceResourceID", &c.WorkspaceResourceID) + 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 ConnectionResetSharedKey. +func (c ConnectionResetSharedKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyLength", c.KeyLength) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionResetSharedKey. +func (c *ConnectionResetSharedKey) 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 "keyLength": + err = unpopulate(val, "KeyLength", &c.KeyLength) + 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 ConnectionSharedKey. +func (c ConnectionSharedKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionSharedKey. +func (c *ConnectionSharedKey) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ConnectionStateSnapshot. +func (c ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) + populate(objectMap, "connectionState", c.ConnectionState) + populateTimeRFC3339(objectMap, "endTime", c.EndTime) + populate(objectMap, "evaluationState", c.EvaluationState) + populate(objectMap, "hops", c.Hops) + populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) + populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) + populate(objectMap, "probesFailed", c.ProbesFailed) + populate(objectMap, "probesSent", c.ProbesSent) + populateTimeRFC3339(objectMap, "startTime", c.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStateSnapshot. +func (c *ConnectionStateSnapshot) 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 "avgLatencyInMs": + err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) + delete(rawMsg, key) + case "connectionState": + err = unpopulate(val, "ConnectionState", &c.ConnectionState) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) + delete(rawMsg, key) + case "evaluationState": + err = unpopulate(val, "EvaluationState", &c.EvaluationState) + delete(rawMsg, key) + case "hops": + err = unpopulate(val, "Hops", &c.Hops) + delete(rawMsg, key) + case "maxLatencyInMs": + err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) + delete(rawMsg, key) + case "minLatencyInMs": + err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) + delete(rawMsg, key) + case "probesFailed": + err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) + delete(rawMsg, key) + case "probesSent": + err = unpopulate(val, "ProbesSent", &c.ProbesSent) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) + 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 ConnectivityConfiguration. +func (c ConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfiguration. +func (c *ConnectivityConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectivityConfigurationListResult. +func (c ConnectivityConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfigurationListResult. +func (c *ConnectivityConfigurationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 ConnectivityConfigurationProperties. +func (c ConnectivityConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliesToGroups", c.AppliesToGroups) + populate(objectMap, "connectivityTopology", c.ConnectivityTopology) + populate(objectMap, "deleteExistingPeering", c.DeleteExistingPeering) + populate(objectMap, "description", c.Description) + populate(objectMap, "hubs", c.Hubs) + populate(objectMap, "isGlobal", c.IsGlobal) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfigurationProperties. +func (c *ConnectivityConfigurationProperties) 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 "appliesToGroups": + err = unpopulate(val, "AppliesToGroups", &c.AppliesToGroups) + delete(rawMsg, key) + case "connectivityTopology": + err = unpopulate(val, "ConnectivityTopology", &c.ConnectivityTopology) + delete(rawMsg, key) + case "deleteExistingPeering": + err = unpopulate(val, "DeleteExistingPeering", &c.DeleteExistingPeering) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "hubs": + err = unpopulate(val, "Hubs", &c.Hubs) + delete(rawMsg, key) + case "isGlobal": + err = unpopulate(val, "IsGlobal", &c.IsGlobal) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ConnectivityDestination. +func (c ConnectivityDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "port", c.Port) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityDestination. +func (c *ConnectivityDestination) 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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ConnectivityGroupItem. +func (c ConnectivityGroupItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupConnectivity", c.GroupConnectivity) + populate(objectMap, "isGlobal", c.IsGlobal) + populate(objectMap, "networkGroupId", c.NetworkGroupID) + populate(objectMap, "useHubGateway", c.UseHubGateway) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityGroupItem. +func (c *ConnectivityGroupItem) 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 "groupConnectivity": + err = unpopulate(val, "GroupConnectivity", &c.GroupConnectivity) + delete(rawMsg, key) + case "isGlobal": + err = unpopulate(val, "IsGlobal", &c.IsGlobal) + delete(rawMsg, key) + case "networkGroupId": + err = unpopulate(val, "NetworkGroupID", &c.NetworkGroupID) + delete(rawMsg, key) + case "useHubGateway": + err = unpopulate(val, "UseHubGateway", &c.UseHubGateway) + 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 ConnectivityHop. +func (c ConnectivityHop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "id", c.ID) + populate(objectMap, "issues", c.Issues) + populate(objectMap, "links", c.Links) + populate(objectMap, "nextHopIds", c.NextHopIDs) + populate(objectMap, "previousHopIds", c.PreviousHopIDs) + populate(objectMap, "previousLinks", c.PreviousLinks) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop. +func (c *ConnectivityHop) 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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "issues": + err = unpopulate(val, "Issues", &c.Issues) + delete(rawMsg, key) + case "links": + err = unpopulate(val, "Links", &c.Links) + delete(rawMsg, key) + case "nextHopIds": + err = unpopulate(val, "NextHopIDs", &c.NextHopIDs) + delete(rawMsg, key) + case "previousHopIds": + err = unpopulate(val, "PreviousHopIDs", &c.PreviousHopIDs) + delete(rawMsg, key) + case "previousLinks": + err = unpopulate(val, "PreviousLinks", &c.PreviousLinks) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectivityInformation. +func (c ConnectivityInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) + populate(objectMap, "connectionStatus", c.ConnectionStatus) + populate(objectMap, "hops", c.Hops) + populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) + populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) + populate(objectMap, "probesFailed", c.ProbesFailed) + populate(objectMap, "probesSent", c.ProbesSent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityInformation. +func (c *ConnectivityInformation) 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 "avgLatencyInMs": + err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &c.ConnectionStatus) + delete(rawMsg, key) + case "hops": + err = unpopulate(val, "Hops", &c.Hops) + delete(rawMsg, key) + case "maxLatencyInMs": + err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) + delete(rawMsg, key) + case "minLatencyInMs": + err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) + delete(rawMsg, key) + case "probesFailed": + err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) + delete(rawMsg, key) + case "probesSent": + err = unpopulate(val, "ProbesSent", &c.ProbesSent) + 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 ConnectivityIssue. +func (c ConnectivityIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "context", c.Context) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "severity", c.Severity) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue. +func (c *ConnectivityIssue) 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 "context": + err = unpopulate(val, "Context", &c.Context) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConnectivityParameters. +func (c ConnectivityParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "protocolConfiguration", c.ProtocolConfiguration) + populate(objectMap, "source", c.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityParameters. +func (c *ConnectivityParameters) 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 "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "preferredIPVersion": + err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) + delete(rawMsg, key) + case "protocolConfiguration": + err = unpopulate(val, "ProtocolConfiguration", &c.ProtocolConfiguration) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + 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 ConnectivitySource. +func (c ConnectivitySource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", c.Port) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivitySource. +func (c *ConnectivitySource) 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 "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 Container. +func (c Container) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Container. +func (c *Container) 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 "id": + err = unpopulate(val, "ID", &c.ID) + 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 ContainerNetworkInterface. +func (c ContainerNetworkInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterface. +func (c *ContainerNetworkInterface) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ContainerNetworkInterfaceConfiguration. +func (c ContainerNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceConfiguration. +func (c *ContainerNetworkInterfaceConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ContainerNetworkInterfaceConfigurationPropertiesFormat. +func (c ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerNetworkInterfaces", c.ContainerNetworkInterfaces) + populate(objectMap, "ipConfigurations", c.IPConfigurations) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceConfigurationPropertiesFormat. +func (c *ContainerNetworkInterfaceConfigurationPropertiesFormat) 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 "containerNetworkInterfaces": + err = unpopulate(val, "ContainerNetworkInterfaces", &c.ContainerNetworkInterfaces) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &c.IPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ContainerNetworkInterfaceIPConfiguration. +func (c ContainerNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceIPConfiguration. +func (c *ContainerNetworkInterfaceIPConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ContainerNetworkInterfaceIPConfigurationPropertiesFormat. +func (c ContainerNetworkInterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfaceIPConfigurationPropertiesFormat. +func (c *ContainerNetworkInterfaceIPConfigurationPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 ContainerNetworkInterfacePropertiesFormat. +func (c ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "container", c.Container) + populate(objectMap, "containerNetworkInterfaceConfiguration", c.ContainerNetworkInterfaceConfiguration) + populate(objectMap, "ipConfigurations", c.IPConfigurations) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerNetworkInterfacePropertiesFormat. +func (c *ContainerNetworkInterfacePropertiesFormat) 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 "container": + err = unpopulate(val, "Container", &c.Container) + delete(rawMsg, key) + case "containerNetworkInterfaceConfiguration": + err = unpopulate(val, "ContainerNetworkInterfaceConfiguration", &c.ContainerNetworkInterfaceConfiguration) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &c.IPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 Criterion. +func (c Criterion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asPath", c.AsPath) + populate(objectMap, "community", c.Community) + populate(objectMap, "matchCondition", c.MatchCondition) + populate(objectMap, "routePrefix", c.RoutePrefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Criterion. +func (c *Criterion) 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 "asPath": + err = unpopulate(val, "AsPath", &c.AsPath) + delete(rawMsg, key) + case "community": + err = unpopulate(val, "Community", &c.Community) + delete(rawMsg, key) + case "matchCondition": + err = unpopulate(val, "MatchCondition", &c.MatchCondition) + delete(rawMsg, key) + case "routePrefix": + err = unpopulate(val, "RoutePrefix", &c.RoutePrefix) + 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 CrossTenantScopes. +func (c CrossTenantScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managementGroups", c.ManagementGroups) + populate(objectMap, "subscriptions", c.Subscriptions) + populate(objectMap, "tenantId", c.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CrossTenantScopes. +func (c *CrossTenantScopes) 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 "managementGroups": + err = unpopulate(val, "ManagementGroups", &c.ManagementGroups) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &c.Subscriptions) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &c.TenantID) + 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 CustomDNSConfigPropertiesFormat. +func (c CustomDNSConfigPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", c.Fqdn) + populate(objectMap, "ipAddresses", c.IPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDNSConfigPropertiesFormat. +func (c *CustomDNSConfigPropertiesFormat) 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 "fqdn": + err = unpopulate(val, "Fqdn", &c.Fqdn) + delete(rawMsg, key) + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &c.IPAddresses) + 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 CustomIPPrefix. +func (c CustomIPPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "extendedLocation", c.ExtendedLocation) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + populate(objectMap, "zones", c.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefix. +func (c *CustomIPPrefix) 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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &c.Zones) + 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 CustomIPPrefixListResult. +func (c CustomIPPrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefixListResult. +func (c *CustomIPPrefixListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 CustomIPPrefixPropertiesFormat. +func (c CustomIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asn", c.Asn) + populate(objectMap, "authorizationMessage", c.AuthorizationMessage) + populate(objectMap, "childCustomIpPrefixes", c.ChildCustomIPPrefixes) + populate(objectMap, "cidr", c.Cidr) + populate(objectMap, "commissionedState", c.CommissionedState) + populate(objectMap, "customIpPrefixParent", c.CustomIPPrefixParent) + populate(objectMap, "expressRouteAdvertise", c.ExpressRouteAdvertise) + populate(objectMap, "failedReason", c.FailedReason) + populate(objectMap, "geo", c.Geo) + populate(objectMap, "noInternetAdvertise", c.NoInternetAdvertise) + populate(objectMap, "prefixType", c.PrefixType) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publicIpPrefixes", c.PublicIPPrefixes) + populate(objectMap, "resourceGuid", c.ResourceGUID) + populate(objectMap, "signedMessage", c.SignedMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomIPPrefixPropertiesFormat. +func (c *CustomIPPrefixPropertiesFormat) 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 "asn": + err = unpopulate(val, "Asn", &c.Asn) + delete(rawMsg, key) + case "authorizationMessage": + err = unpopulate(val, "AuthorizationMessage", &c.AuthorizationMessage) + delete(rawMsg, key) + case "childCustomIpPrefixes": + err = unpopulate(val, "ChildCustomIPPrefixes", &c.ChildCustomIPPrefixes) + delete(rawMsg, key) + case "cidr": + err = unpopulate(val, "Cidr", &c.Cidr) + delete(rawMsg, key) + case "commissionedState": + err = unpopulate(val, "CommissionedState", &c.CommissionedState) + delete(rawMsg, key) + case "customIpPrefixParent": + err = unpopulate(val, "CustomIPPrefixParent", &c.CustomIPPrefixParent) + delete(rawMsg, key) + case "expressRouteAdvertise": + err = unpopulate(val, "ExpressRouteAdvertise", &c.ExpressRouteAdvertise) + delete(rawMsg, key) + case "failedReason": + err = unpopulate(val, "FailedReason", &c.FailedReason) + delete(rawMsg, key) + case "geo": + err = unpopulate(val, "Geo", &c.Geo) + delete(rawMsg, key) + case "noInternetAdvertise": + err = unpopulate(val, "NoInternetAdvertise", &c.NoInternetAdvertise) + delete(rawMsg, key) + case "prefixType": + err = unpopulate(val, "PrefixType", &c.PrefixType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publicIpPrefixes": + err = unpopulate(val, "PublicIPPrefixes", &c.PublicIPPrefixes) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &c.ResourceGUID) + delete(rawMsg, key) + case "signedMessage": + err = unpopulate(val, "SignedMessage", &c.SignedMessage) + 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 DNSNameAvailabilityResult. +func (d DNSNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", d.Available) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSNameAvailabilityResult. +func (d *DNSNameAvailabilityResult) 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 "available": + err = unpopulate(val, "Available", &d.Available) + 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 DNSSettings. +func (d DNSSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableProxy", d.EnableProxy) + populate(objectMap, "requireProxyForNetworkRules", d.RequireProxyForNetworkRules) + populate(objectMap, "servers", d.Servers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSSettings. +func (d *DNSSettings) 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 "enableProxy": + err = unpopulate(val, "EnableProxy", &d.EnableProxy) + delete(rawMsg, key) + case "requireProxyForNetworkRules": + err = unpopulate(val, "RequireProxyForNetworkRules", &d.RequireProxyForNetworkRules) + delete(rawMsg, key) + case "servers": + err = unpopulate(val, "Servers", &d.Servers) + 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 DdosCustomPolicy. +func (d DdosCustomPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosCustomPolicy. +func (d *DdosCustomPolicy) 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 "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + 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 "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DdosCustomPolicyPropertiesFormat. +func (d DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceGuid", d.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosCustomPolicyPropertiesFormat. +func (d *DdosCustomPolicyPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) + 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 DdosProtectionPlan. +func (d DdosProtectionPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosProtectionPlan. +func (d *DdosProtectionPlan) 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 "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + 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 "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DdosProtectionPlanListResult. +func (d DdosProtectionPlanListResult) 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 DdosProtectionPlanListResult. +func (d *DdosProtectionPlanListResult) 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 DdosProtectionPlanPropertiesFormat. +func (d DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "publicIPAddresses", d.PublicIPAddresses) + populate(objectMap, "resourceGuid", d.ResourceGUID) + populate(objectMap, "virtualNetworks", d.VirtualNetworks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosProtectionPlanPropertiesFormat. +func (d *DdosProtectionPlanPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &d.PublicIPAddresses) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) + delete(rawMsg, key) + case "virtualNetworks": + err = unpopulate(val, "VirtualNetworks", &d.VirtualNetworks) + 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 DdosSettings. +func (d DdosSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ddosProtectionPlan", d.DdosProtectionPlan) + populate(objectMap, "protectionMode", d.ProtectionMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DdosSettings. +func (d *DdosSettings) 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 "ddosProtectionPlan": + err = unpopulate(val, "DdosProtectionPlan", &d.DdosProtectionPlan) + delete(rawMsg, key) + case "protectionMode": + err = unpopulate(val, "ProtectionMode", &d.ProtectionMode) + 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 DefaultAdminPropertiesFormat. +func (d DefaultAdminPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", d.Access) + populate(objectMap, "description", d.Description) + populate(objectMap, "destinationPortRanges", d.DestinationPortRanges) + populate(objectMap, "destinations", d.Destinations) + populate(objectMap, "direction", d.Direction) + populate(objectMap, "flag", d.Flag) + populate(objectMap, "priority", d.Priority) + populate(objectMap, "protocol", d.Protocol) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "sourcePortRanges", d.SourcePortRanges) + populate(objectMap, "sources", d.Sources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAdminPropertiesFormat. +func (d *DefaultAdminPropertiesFormat) 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 "access": + err = unpopulate(val, "Access", &d.Access) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &d.DestinationPortRanges) + delete(rawMsg, key) + case "destinations": + err = unpopulate(val, "Destinations", &d.Destinations) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &d.Direction) + delete(rawMsg, key) + case "flag": + err = unpopulate(val, "Flag", &d.Flag) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &d.Priority) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &d.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &d.SourcePortRanges) + delete(rawMsg, key) + case "sources": + err = unpopulate(val, "Sources", &d.Sources) + 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 DefaultAdminRule. +func (d DefaultAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + objectMap["kind"] = AdminRuleKindDefault + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAdminRule. +func (d *DefaultAdminRule) 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 "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + 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 "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + 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 DefaultRuleSetPropertyFormat. +func (d DefaultRuleSetPropertyFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleSetType", d.RuleSetType) + populate(objectMap, "ruleSetVersion", d.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultRuleSetPropertyFormat. +func (d *DefaultRuleSetPropertyFormat) 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 "ruleSetType": + err = unpopulate(val, "RuleSetType", &d.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &d.RuleSetVersion) + 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 Delegation. +func (d Delegation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + 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 Delegation. +func (d *Delegation) 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 "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, 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 DelegationProperties. +func (d DelegationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "serviceName", d.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DelegationProperties. +func (d *DelegationProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &d.ServiceName) + 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 DeviceProperties. +func (d DeviceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deviceModel", d.DeviceModel) + populate(objectMap, "deviceVendor", d.DeviceVendor) + populate(objectMap, "linkSpeedInMbps", d.LinkSpeedInMbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceProperties. +func (d *DeviceProperties) 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 "deviceModel": + err = unpopulate(val, "DeviceModel", &d.DeviceModel) + delete(rawMsg, key) + case "deviceVendor": + err = unpopulate(val, "DeviceVendor", &d.DeviceVendor) + delete(rawMsg, key) + case "linkSpeedInMbps": + err = unpopulate(val, "LinkSpeedInMbps", &d.LinkSpeedInMbps) + 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 DhcpOptions. +func (d DhcpOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsServers", d.DNSServers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DhcpOptions. +func (d *DhcpOptions) 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 "dnsServers": + err = unpopulate(val, "DNSServers", &d.DNSServers) + 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, "internalName", d.InternalName) + 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 "internalName": + err = unpopulate(val, "InternalName", &d.InternalName) + 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 DscpConfiguration. +func (d DscpConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DscpConfiguration. +func (d *DscpConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + 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 "tags": + err = unpopulate(val, "Tags", &d.Tags) + 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 DscpConfigurationListResult. +func (d DscpConfigurationListResult) 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 DscpConfigurationListResult. +func (d *DscpConfigurationListResult) 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 DscpConfigurationPropertiesFormat. +func (d DscpConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedNetworkInterfaces", d.AssociatedNetworkInterfaces) + populate(objectMap, "destinationIpRanges", d.DestinationIPRanges) + populate(objectMap, "destinationPortRanges", d.DestinationPortRanges) + populate(objectMap, "markings", d.Markings) + populate(objectMap, "protocol", d.Protocol) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "qosCollectionId", d.QosCollectionID) + populate(objectMap, "qosDefinitionCollection", d.QosDefinitionCollection) + populate(objectMap, "resourceGuid", d.ResourceGUID) + populate(objectMap, "sourceIpRanges", d.SourceIPRanges) + populate(objectMap, "sourcePortRanges", d.SourcePortRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DscpConfigurationPropertiesFormat. +func (d *DscpConfigurationPropertiesFormat) 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 "associatedNetworkInterfaces": + err = unpopulate(val, "AssociatedNetworkInterfaces", &d.AssociatedNetworkInterfaces) + delete(rawMsg, key) + case "destinationIpRanges": + err = unpopulate(val, "DestinationIPRanges", &d.DestinationIPRanges) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &d.DestinationPortRanges) + delete(rawMsg, key) + case "markings": + err = unpopulate(val, "Markings", &d.Markings) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &d.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "qosCollectionId": + err = unpopulate(val, "QosCollectionID", &d.QosCollectionID) + delete(rawMsg, key) + case "qosDefinitionCollection": + err = unpopulate(val, "QosDefinitionCollection", &d.QosDefinitionCollection) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) + delete(rawMsg, key) + case "sourceIpRanges": + err = unpopulate(val, "SourceIPRanges", &d.SourceIPRanges) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &d.SourcePortRanges) + 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 EffectiveBaseSecurityAdminRule. +func (e EffectiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationDescription", e.ConfigurationDescription) + populate(objectMap, "id", e.ID) + objectMap["kind"] = e.Kind + populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) + populate(objectMap, "ruleGroups", e.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveBaseSecurityAdminRule. +func (e *EffectiveBaseSecurityAdminRule) 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 "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &e.RuleGroups) + 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 EffectiveConnectivityConfiguration. +func (e EffectiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationGroups", e.ConfigurationGroups) + populate(objectMap, "id", e.ID) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveConnectivityConfiguration. +func (e *EffectiveConnectivityConfiguration) 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 "configurationGroups": + err = unpopulate(val, "ConfigurationGroups", &e.ConfigurationGroups) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 EffectiveDefaultSecurityAdminRule. +func (e EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationDescription", e.ConfigurationDescription) + populate(objectMap, "id", e.ID) + objectMap["kind"] = EffectiveAdminRuleKindDefault + populate(objectMap, "properties", e.Properties) + populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) + populate(objectMap, "ruleGroups", e.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveDefaultSecurityAdminRule. +func (e *EffectiveDefaultSecurityAdminRule) 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 "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &e.RuleGroups) + 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 EffectiveNetworkSecurityGroup. +func (e EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "association", e.Association) + populate(objectMap, "effectiveSecurityRules", e.EffectiveSecurityRules) + populate(objectMap, "networkSecurityGroup", e.NetworkSecurityGroup) + populate(objectMap, "tagMap", e.TagMap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroup. +func (e *EffectiveNetworkSecurityGroup) 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 "association": + err = unpopulate(val, "Association", &e.Association) + delete(rawMsg, key) + case "effectiveSecurityRules": + err = unpopulate(val, "EffectiveSecurityRules", &e.EffectiveSecurityRules) + delete(rawMsg, key) + case "networkSecurityGroup": + err = unpopulate(val, "NetworkSecurityGroup", &e.NetworkSecurityGroup) + delete(rawMsg, key) + case "tagMap": + err = unpopulate(val, "TagMap", &e.TagMap) + 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 EffectiveNetworkSecurityGroupAssociation. +func (e EffectiveNetworkSecurityGroupAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkInterface", e.NetworkInterface) + populate(objectMap, "networkManager", e.NetworkManager) + populate(objectMap, "subnet", e.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroupAssociation. +func (e *EffectiveNetworkSecurityGroupAssociation) 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 "networkInterface": + err = unpopulate(val, "NetworkInterface", &e.NetworkInterface) + delete(rawMsg, key) + case "networkManager": + err = unpopulate(val, "NetworkManager", &e.NetworkManager) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &e.Subnet) + 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 EffectiveNetworkSecurityGroupListResult. +func (e EffectiveNetworkSecurityGroupListResult) 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 EffectiveNetworkSecurityGroupListResult. +func (e *EffectiveNetworkSecurityGroupListResult) 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 EffectiveNetworkSecurityRule. +func (e EffectiveNetworkSecurityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", e.Access) + populate(objectMap, "destinationAddressPrefix", e.DestinationAddressPrefix) + populate(objectMap, "destinationAddressPrefixes", e.DestinationAddressPrefixes) + populate(objectMap, "destinationPortRange", e.DestinationPortRange) + populate(objectMap, "destinationPortRanges", e.DestinationPortRanges) + populate(objectMap, "direction", e.Direction) + populate(objectMap, "expandedDestinationAddressPrefix", e.ExpandedDestinationAddressPrefix) + populate(objectMap, "expandedSourceAddressPrefix", e.ExpandedSourceAddressPrefix) + populate(objectMap, "name", e.Name) + populate(objectMap, "priority", e.Priority) + populate(objectMap, "protocol", e.Protocol) + populate(objectMap, "sourceAddressPrefix", e.SourceAddressPrefix) + populate(objectMap, "sourceAddressPrefixes", e.SourceAddressPrefixes) + populate(objectMap, "sourcePortRange", e.SourcePortRange) + populate(objectMap, "sourcePortRanges", e.SourcePortRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityRule. +func (e *EffectiveNetworkSecurityRule) 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 "access": + err = unpopulate(val, "Access", &e.Access) + delete(rawMsg, key) + case "destinationAddressPrefix": + err = unpopulate(val, "DestinationAddressPrefix", &e.DestinationAddressPrefix) + delete(rawMsg, key) + case "destinationAddressPrefixes": + err = unpopulate(val, "DestinationAddressPrefixes", &e.DestinationAddressPrefixes) + delete(rawMsg, key) + case "destinationPortRange": + err = unpopulate(val, "DestinationPortRange", &e.DestinationPortRange) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &e.DestinationPortRanges) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &e.Direction) + delete(rawMsg, key) + case "expandedDestinationAddressPrefix": + err = unpopulate(val, "ExpandedDestinationAddressPrefix", &e.ExpandedDestinationAddressPrefix) + delete(rawMsg, key) + case "expandedSourceAddressPrefix": + err = unpopulate(val, "ExpandedSourceAddressPrefix", &e.ExpandedSourceAddressPrefix) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &e.Priority) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &e.Protocol) + delete(rawMsg, key) + case "sourceAddressPrefix": + err = unpopulate(val, "SourceAddressPrefix", &e.SourceAddressPrefix) + delete(rawMsg, key) + case "sourceAddressPrefixes": + err = unpopulate(val, "SourceAddressPrefixes", &e.SourceAddressPrefixes) + delete(rawMsg, key) + case "sourcePortRange": + err = unpopulate(val, "SourcePortRange", &e.SourcePortRange) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &e.SourcePortRanges) + 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 EffectiveRoute. +func (e EffectiveRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", e.AddressPrefix) + populate(objectMap, "disableBgpRoutePropagation", e.DisableBgpRoutePropagation) + populate(objectMap, "name", e.Name) + populate(objectMap, "nextHopIpAddress", e.NextHopIPAddress) + populate(objectMap, "nextHopType", e.NextHopType) + populate(objectMap, "source", e.Source) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRoute. +func (e *EffectiveRoute) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &e.AddressPrefix) + delete(rawMsg, key) + case "disableBgpRoutePropagation": + err = unpopulate(val, "DisableBgpRoutePropagation", &e.DisableBgpRoutePropagation) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &e.NextHopIPAddress) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &e.NextHopType) + 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 EffectiveRouteListResult. +func (e EffectiveRouteListResult) 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 EffectiveRouteListResult. +func (e *EffectiveRouteListResult) 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 EffectiveRouteMapRoute. +func (e EffectiveRouteMapRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asPath", e.AsPath) + populate(objectMap, "bgpCommunities", e.BgpCommunities) + populate(objectMap, "prefix", e.Prefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRouteMapRoute. +func (e *EffectiveRouteMapRoute) 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 "asPath": + err = unpopulate(val, "AsPath", &e.AsPath) + delete(rawMsg, key) + case "bgpCommunities": + err = unpopulate(val, "BgpCommunities", &e.BgpCommunities) + 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 EffectiveRoutesParameters. +func (e EffectiveRoutesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", e.ResourceID) + populate(objectMap, "virtualWanResourceType", e.VirtualWanResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveRoutesParameters. +func (e *EffectiveRoutesParameters) 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 "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) + delete(rawMsg, key) + case "virtualWanResourceType": + err = unpopulate(val, "VirtualWanResourceType", &e.VirtualWanResourceType) + 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 EffectiveSecurityAdminRule. +func (e EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationDescription", e.ConfigurationDescription) + populate(objectMap, "id", e.ID) + objectMap["kind"] = EffectiveAdminRuleKindCustom + populate(objectMap, "properties", e.Properties) + populate(objectMap, "ruleCollectionAppliesToGroups", e.RuleCollectionAppliesToGroups) + populate(objectMap, "ruleCollectionDescription", e.RuleCollectionDescription) + populate(objectMap, "ruleGroups", e.RuleGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveSecurityAdminRule. +func (e *EffectiveSecurityAdminRule) 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 "configurationDescription": + err = unpopulate(val, "ConfigurationDescription", &e.ConfigurationDescription) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "ruleCollectionAppliesToGroups": + err = unpopulate(val, "RuleCollectionAppliesToGroups", &e.RuleCollectionAppliesToGroups) + delete(rawMsg, key) + case "ruleCollectionDescription": + err = unpopulate(val, "RuleCollectionDescription", &e.RuleCollectionDescription) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &e.RuleGroups) + 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 EndpointServiceResult. +func (e EndpointServiceResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 EndpointServiceResult. +func (e *EndpointServiceResult) 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 "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 EndpointServicesListResult. +func (e EndpointServicesListResult) 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 EndpointServicesListResult. +func (e *EndpointServicesListResult) 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 Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "innerError", e.InnerError) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) 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 "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "innerError": + err = unpopulate(val, "InnerError", &e.InnerError) + 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 ErrorDetails. +func (e ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. +func (e *ErrorDetails) 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) + 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 EvaluatedNetworkSecurityGroup. +func (e EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedTo", e.AppliedTo) + populate(objectMap, "matchedRule", e.MatchedRule) + populate(objectMap, "networkSecurityGroupId", e.NetworkSecurityGroupID) + populate(objectMap, "rulesEvaluationResult", e.RulesEvaluationResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatedNetworkSecurityGroup. +func (e *EvaluatedNetworkSecurityGroup) 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 "appliedTo": + err = unpopulate(val, "AppliedTo", &e.AppliedTo) + delete(rawMsg, key) + case "matchedRule": + err = unpopulate(val, "MatchedRule", &e.MatchedRule) + delete(rawMsg, key) + case "networkSecurityGroupId": + err = unpopulate(val, "NetworkSecurityGroupID", &e.NetworkSecurityGroupID) + delete(rawMsg, key) + case "rulesEvaluationResult": + err = unpopulate(val, "RulesEvaluationResult", &e.RulesEvaluationResult) + 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 ExclusionManagedRule. +func (e ExclusionManagedRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleId", e.RuleID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRule. +func (e *ExclusionManagedRule) 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 "ruleId": + err = unpopulate(val, "RuleID", &e.RuleID) + 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 ExclusionManagedRuleGroup. +func (e ExclusionManagedRuleGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroupName", e.RuleGroupName) + populate(objectMap, "rules", e.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRuleGroup. +func (e *ExclusionManagedRuleGroup) 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 "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &e.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &e.Rules) + 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 ExclusionManagedRuleSet. +func (e ExclusionManagedRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroups", e.RuleGroups) + populate(objectMap, "ruleSetType", e.RuleSetType) + populate(objectMap, "ruleSetVersion", e.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExclusionManagedRuleSet. +func (e *ExclusionManagedRuleSet) 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 "ruleGroups": + err = unpopulate(val, "RuleGroups", &e.RuleGroups) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &e.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &e.RuleSetVersion) + 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 ExplicitProxySettings. +func (e ExplicitProxySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableExplicitProxy", e.EnableExplicitProxy) + populate(objectMap, "enablePacFile", e.EnablePacFile) + populate(objectMap, "httpPort", e.HTTPPort) + populate(objectMap, "httpsPort", e.HTTPSPort) + populate(objectMap, "pacFile", e.PacFile) + populate(objectMap, "pacFilePort", e.PacFilePort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExplicitProxySettings. +func (e *ExplicitProxySettings) 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 "enableExplicitProxy": + err = unpopulate(val, "EnableExplicitProxy", &e.EnableExplicitProxy) + delete(rawMsg, key) + case "enablePacFile": + err = unpopulate(val, "EnablePacFile", &e.EnablePacFile) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &e.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &e.HTTPSPort) + delete(rawMsg, key) + case "pacFile": + err = unpopulate(val, "PacFile", &e.PacFile) + delete(rawMsg, key) + case "pacFilePort": + err = unpopulate(val, "PacFilePort", &e.PacFilePort) + 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 ExpressRouteCircuit. +func (e ExpressRouteCircuit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuit. +func (e *ExpressRouteCircuit) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRouteCircuitArpTable. +func (e ExpressRouteCircuitArpTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "age", e.Age) + populate(objectMap, "ipAddress", e.IPAddress) + populate(objectMap, "interface", e.Interface) + populate(objectMap, "macAddress", e.MacAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitArpTable. +func (e *ExpressRouteCircuitArpTable) 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 "age": + err = unpopulate(val, "Age", &e.Age) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &e.IPAddress) + delete(rawMsg, key) + case "interface": + err = unpopulate(val, "Interface", &e.Interface) + delete(rawMsg, key) + case "macAddress": + err = unpopulate(val, "MacAddress", &e.MacAddress) + 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 ExpressRouteCircuitAuthorization. +func (e ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitAuthorization. +func (e *ExpressRouteCircuitAuthorization) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteCircuitConnection. +func (e ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitConnection. +func (e *ExpressRouteCircuitConnection) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteCircuitConnectionListResult. +func (e ExpressRouteCircuitConnectionListResult) 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 ExpressRouteCircuitConnectionListResult. +func (e *ExpressRouteCircuitConnectionListResult) 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 ExpressRouteCircuitConnectionPropertiesFormat. +func (e ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", e.AddressPrefix) + populate(objectMap, "authorizationKey", e.AuthorizationKey) + populate(objectMap, "circuitConnectionStatus", e.CircuitConnectionStatus) + populate(objectMap, "expressRouteCircuitPeering", e.ExpressRouteCircuitPeering) + populate(objectMap, "ipv6CircuitConnectionConfig", e.IPv6CircuitConnectionConfig) + populate(objectMap, "peerExpressRouteCircuitPeering", e.PeerExpressRouteCircuitPeering) + populate(objectMap, "provisioningState", e.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitConnectionPropertiesFormat. +func (e *ExpressRouteCircuitConnectionPropertiesFormat) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &e.AddressPrefix) + delete(rawMsg, key) + case "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) + delete(rawMsg, key) + case "circuitConnectionStatus": + err = unpopulate(val, "CircuitConnectionStatus", &e.CircuitConnectionStatus) + delete(rawMsg, key) + case "expressRouteCircuitPeering": + err = unpopulate(val, "ExpressRouteCircuitPeering", &e.ExpressRouteCircuitPeering) + delete(rawMsg, key) + case "ipv6CircuitConnectionConfig": + err = unpopulate(val, "IPv6CircuitConnectionConfig", &e.IPv6CircuitConnectionConfig) + delete(rawMsg, key) + case "peerExpressRouteCircuitPeering": + err = unpopulate(val, "PeerExpressRouteCircuitPeering", &e.PeerExpressRouteCircuitPeering) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + 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 ExpressRouteCircuitListResult. +func (e ExpressRouteCircuitListResult) 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 ExpressRouteCircuitListResult. +func (e *ExpressRouteCircuitListResult) 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 ExpressRouteCircuitPeering. +func (e ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeering. +func (e *ExpressRouteCircuitPeering) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteCircuitPeeringConfig. +func (e ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advertisedCommunities", e.AdvertisedCommunities) + populate(objectMap, "advertisedPublicPrefixes", e.AdvertisedPublicPrefixes) + populate(objectMap, "advertisedPublicPrefixesState", e.AdvertisedPublicPrefixesState) + populate(objectMap, "customerASN", e.CustomerASN) + populate(objectMap, "legacyMode", e.LegacyMode) + populate(objectMap, "routingRegistryName", e.RoutingRegistryName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringConfig. +func (e *ExpressRouteCircuitPeeringConfig) 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 "advertisedCommunities": + err = unpopulate(val, "AdvertisedCommunities", &e.AdvertisedCommunities) + delete(rawMsg, key) + case "advertisedPublicPrefixes": + err = unpopulate(val, "AdvertisedPublicPrefixes", &e.AdvertisedPublicPrefixes) + delete(rawMsg, key) + case "advertisedPublicPrefixesState": + err = unpopulate(val, "AdvertisedPublicPrefixesState", &e.AdvertisedPublicPrefixesState) + delete(rawMsg, key) + case "customerASN": + err = unpopulate(val, "CustomerASN", &e.CustomerASN) + delete(rawMsg, key) + case "legacyMode": + err = unpopulate(val, "LegacyMode", &e.LegacyMode) + delete(rawMsg, key) + case "routingRegistryName": + err = unpopulate(val, "RoutingRegistryName", &e.RoutingRegistryName) + 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 ExpressRouteCircuitPeeringID. +func (e ExpressRouteCircuitPeeringID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringID. +func (e *ExpressRouteCircuitPeeringID) 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 "id": + err = unpopulate(val, "ID", &e.ID) + 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 ExpressRouteCircuitPeeringListResult. +func (e ExpressRouteCircuitPeeringListResult) 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 ExpressRouteCircuitPeeringListResult. +func (e *ExpressRouteCircuitPeeringListResult) 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 ExpressRouteCircuitPeeringPropertiesFormat. +func (e ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureASN", e.AzureASN) + populate(objectMap, "connections", e.Connections) + populate(objectMap, "expressRouteConnection", e.ExpressRouteConnection) + populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) + populate(objectMap, "ipv6PeeringConfig", e.IPv6PeeringConfig) + populate(objectMap, "lastModifiedBy", e.LastModifiedBy) + populate(objectMap, "microsoftPeeringConfig", e.MicrosoftPeeringConfig) + populate(objectMap, "peerASN", e.PeerASN) + populate(objectMap, "peeredConnections", e.PeeredConnections) + populate(objectMap, "peeringType", e.PeeringType) + populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) + populate(objectMap, "primaryPeerAddressPrefix", e.PrimaryPeerAddressPrefix) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "routeFilter", e.RouteFilter) + populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) + populate(objectMap, "secondaryPeerAddressPrefix", e.SecondaryPeerAddressPrefix) + populate(objectMap, "sharedKey", e.SharedKey) + populate(objectMap, "state", e.State) + populate(objectMap, "stats", e.Stats) + populate(objectMap, "vlanId", e.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPeeringPropertiesFormat. +func (e *ExpressRouteCircuitPeeringPropertiesFormat) 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 "azureASN": + err = unpopulate(val, "AzureASN", &e.AzureASN) + delete(rawMsg, key) + case "connections": + err = unpopulate(val, "Connections", &e.Connections) + delete(rawMsg, key) + case "expressRouteConnection": + err = unpopulate(val, "ExpressRouteConnection", &e.ExpressRouteConnection) + delete(rawMsg, key) + case "gatewayManagerEtag": + err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) + delete(rawMsg, key) + case "ipv6PeeringConfig": + err = unpopulate(val, "IPv6PeeringConfig", &e.IPv6PeeringConfig) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &e.LastModifiedBy) + delete(rawMsg, key) + case "microsoftPeeringConfig": + err = unpopulate(val, "MicrosoftPeeringConfig", &e.MicrosoftPeeringConfig) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &e.PeerASN) + delete(rawMsg, key) + case "peeredConnections": + err = unpopulate(val, "PeeredConnections", &e.PeeredConnections) + delete(rawMsg, key) + case "peeringType": + err = unpopulate(val, "PeeringType", &e.PeeringType) + delete(rawMsg, key) + case "primaryAzurePort": + err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) + delete(rawMsg, key) + case "primaryPeerAddressPrefix": + err = unpopulate(val, "PrimaryPeerAddressPrefix", &e.PrimaryPeerAddressPrefix) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "routeFilter": + err = unpopulate(val, "RouteFilter", &e.RouteFilter) + delete(rawMsg, key) + case "secondaryAzurePort": + err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) + delete(rawMsg, key) + case "secondaryPeerAddressPrefix": + err = unpopulate(val, "SecondaryPeerAddressPrefix", &e.SecondaryPeerAddressPrefix) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &e.SharedKey) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "stats": + err = unpopulate(val, "Stats", &e.Stats) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &e.VlanID) + 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 ExpressRouteCircuitPropertiesFormat. +func (e ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowClassicOperations", e.AllowClassicOperations) + populate(objectMap, "authorizationKey", e.AuthorizationKey) + populate(objectMap, "authorizationStatus", e.AuthorizationStatus) + populate(objectMap, "authorizations", e.Authorizations) + populate(objectMap, "bandwidthInGbps", e.BandwidthInGbps) + populate(objectMap, "circuitProvisioningState", e.CircuitProvisioningState) + populate(objectMap, "expressRoutePort", e.ExpressRoutePort) + populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) + populate(objectMap, "globalReachEnabled", e.GlobalReachEnabled) + populate(objectMap, "peerings", e.Peerings) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "serviceKey", e.ServiceKey) + populate(objectMap, "serviceProviderNotes", e.ServiceProviderNotes) + populate(objectMap, "serviceProviderProperties", e.ServiceProviderProperties) + populate(objectMap, "serviceProviderProvisioningState", e.ServiceProviderProvisioningState) + populate(objectMap, "stag", e.Stag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitPropertiesFormat. +func (e *ExpressRouteCircuitPropertiesFormat) 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 "allowClassicOperations": + err = unpopulate(val, "AllowClassicOperations", &e.AllowClassicOperations) + delete(rawMsg, key) + case "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) + delete(rawMsg, key) + case "authorizationStatus": + err = unpopulate(val, "AuthorizationStatus", &e.AuthorizationStatus) + delete(rawMsg, key) + case "authorizations": + err = unpopulate(val, "Authorizations", &e.Authorizations) + delete(rawMsg, key) + case "bandwidthInGbps": + err = unpopulate(val, "BandwidthInGbps", &e.BandwidthInGbps) + delete(rawMsg, key) + case "circuitProvisioningState": + err = unpopulate(val, "CircuitProvisioningState", &e.CircuitProvisioningState) + delete(rawMsg, key) + case "expressRoutePort": + err = unpopulate(val, "ExpressRoutePort", &e.ExpressRoutePort) + delete(rawMsg, key) + case "gatewayManagerEtag": + err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) + delete(rawMsg, key) + case "globalReachEnabled": + err = unpopulate(val, "GlobalReachEnabled", &e.GlobalReachEnabled) + delete(rawMsg, key) + case "peerings": + err = unpopulate(val, "Peerings", &e.Peerings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "serviceKey": + err = unpopulate(val, "ServiceKey", &e.ServiceKey) + delete(rawMsg, key) + case "serviceProviderNotes": + err = unpopulate(val, "ServiceProviderNotes", &e.ServiceProviderNotes) + delete(rawMsg, key) + case "serviceProviderProperties": + err = unpopulate(val, "ServiceProviderProperties", &e.ServiceProviderProperties) + delete(rawMsg, key) + case "serviceProviderProvisioningState": + err = unpopulate(val, "ServiceProviderProvisioningState", &e.ServiceProviderProvisioningState) + delete(rawMsg, key) + case "stag": + err = unpopulate(val, "Stag", &e.Stag) + 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 ExpressRouteCircuitReference. +func (e ExpressRouteCircuitReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitReference. +func (e *ExpressRouteCircuitReference) 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 "id": + err = unpopulate(val, "ID", &e.ID) + 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 ExpressRouteCircuitRoutesTable. +func (e ExpressRouteCircuitRoutesTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locPrf", e.LocPrf) + populate(objectMap, "network", e.Network) + populate(objectMap, "nextHop", e.NextHop) + populate(objectMap, "path", e.Path) + populate(objectMap, "weight", e.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitRoutesTable. +func (e *ExpressRouteCircuitRoutesTable) 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 "locPrf": + err = unpopulate(val, "LocPrf", &e.LocPrf) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &e.Network) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &e.NextHop) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &e.Path) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &e.Weight) + 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 ExpressRouteCircuitRoutesTableSummary. +func (e ExpressRouteCircuitRoutesTableSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "as", e.As) + populate(objectMap, "neighbor", e.Neighbor) + populate(objectMap, "statePfxRcd", e.StatePfxRcd) + populate(objectMap, "upDown", e.UpDown) + populate(objectMap, "v", e.V) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitRoutesTableSummary. +func (e *ExpressRouteCircuitRoutesTableSummary) 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 "as": + err = unpopulate(val, "As", &e.As) + delete(rawMsg, key) + case "neighbor": + err = unpopulate(val, "Neighbor", &e.Neighbor) + delete(rawMsg, key) + case "statePfxRcd": + err = unpopulate(val, "StatePfxRcd", &e.StatePfxRcd) + delete(rawMsg, key) + case "upDown": + err = unpopulate(val, "UpDown", &e.UpDown) + delete(rawMsg, key) + case "v": + err = unpopulate(val, "V", &e.V) + 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 ExpressRouteCircuitSKU. +func (e ExpressRouteCircuitSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "family", e.Family) + populate(objectMap, "name", e.Name) + populate(objectMap, "tier", e.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitSKU. +func (e *ExpressRouteCircuitSKU) 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 "family": + err = unpopulate(val, "Family", &e.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &e.Tier) + 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 ExpressRouteCircuitServiceProviderProperties. +func (e ExpressRouteCircuitServiceProviderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bandwidthInMbps", e.BandwidthInMbps) + populate(objectMap, "peeringLocation", e.PeeringLocation) + populate(objectMap, "serviceProviderName", e.ServiceProviderName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitServiceProviderProperties. +func (e *ExpressRouteCircuitServiceProviderProperties) 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 "bandwidthInMbps": + err = unpopulate(val, "BandwidthInMbps", &e.BandwidthInMbps) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) + delete(rawMsg, key) + case "serviceProviderName": + err = unpopulate(val, "ServiceProviderName", &e.ServiceProviderName) + 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 ExpressRouteCircuitStats. +func (e ExpressRouteCircuitStats) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primarybytesIn", e.PrimarybytesIn) + populate(objectMap, "primarybytesOut", e.PrimarybytesOut) + populate(objectMap, "secondarybytesIn", e.SecondarybytesIn) + populate(objectMap, "secondarybytesOut", e.SecondarybytesOut) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCircuitStats. +func (e *ExpressRouteCircuitStats) 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 "primarybytesIn": + err = unpopulate(val, "PrimarybytesIn", &e.PrimarybytesIn) + delete(rawMsg, key) + case "primarybytesOut": + err = unpopulate(val, "PrimarybytesOut", &e.PrimarybytesOut) + delete(rawMsg, key) + case "secondarybytesIn": + err = unpopulate(val, "SecondarybytesIn", &e.SecondarybytesIn) + delete(rawMsg, key) + case "secondarybytesOut": + err = unpopulate(val, "SecondarybytesOut", &e.SecondarybytesOut) + 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 ExpressRouteCircuitsArpTableListResult. +func (e ExpressRouteCircuitsArpTableListResult) 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 ExpressRouteCircuitsArpTableListResult. +func (e *ExpressRouteCircuitsArpTableListResult) 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 ExpressRouteCircuitsRoutesTableListResult. +func (e ExpressRouteCircuitsRoutesTableListResult) 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 ExpressRouteCircuitsRoutesTableListResult. +func (e *ExpressRouteCircuitsRoutesTableListResult) 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 ExpressRouteCircuitsRoutesTableSummaryListResult. +func (e ExpressRouteCircuitsRoutesTableSummaryListResult) 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 ExpressRouteCircuitsRoutesTableSummaryListResult. +func (e *ExpressRouteCircuitsRoutesTableSummaryListResult) 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 ExpressRouteConnection. +func (e ExpressRouteConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnection. +func (e *ExpressRouteConnection) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteConnectionID. +func (e ExpressRouteConnectionID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionID. +func (e *ExpressRouteConnectionID) 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 "id": + err = unpopulate(val, "ID", &e.ID) + 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 ExpressRouteConnectionList. +func (e ExpressRouteConnectionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionList. +func (e *ExpressRouteConnectionList) 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 "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 ExpressRouteConnectionProperties. +func (e ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationKey", e.AuthorizationKey) + populate(objectMap, "enableInternetSecurity", e.EnableInternetSecurity) + populate(objectMap, "enablePrivateLinkFastPath", e.EnablePrivateLinkFastPath) + populate(objectMap, "expressRouteCircuitPeering", e.ExpressRouteCircuitPeering) + populate(objectMap, "expressRouteGatewayBypass", e.ExpressRouteGatewayBypass) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "routingConfiguration", e.RoutingConfiguration) + populate(objectMap, "routingWeight", e.RoutingWeight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionProperties. +func (e *ExpressRouteConnectionProperties) 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 "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) + delete(rawMsg, key) + case "enableInternetSecurity": + err = unpopulate(val, "EnableInternetSecurity", &e.EnableInternetSecurity) + delete(rawMsg, key) + case "enablePrivateLinkFastPath": + err = unpopulate(val, "EnablePrivateLinkFastPath", &e.EnablePrivateLinkFastPath) + delete(rawMsg, key) + case "expressRouteCircuitPeering": + err = unpopulate(val, "ExpressRouteCircuitPeering", &e.ExpressRouteCircuitPeering) + delete(rawMsg, key) + case "expressRouteGatewayBypass": + err = unpopulate(val, "ExpressRouteGatewayBypass", &e.ExpressRouteGatewayBypass) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &e.RoutingConfiguration) + delete(rawMsg, key) + case "routingWeight": + err = unpopulate(val, "RoutingWeight", &e.RoutingWeight) + 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 ExpressRouteCrossConnection. +func (e ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnection. +func (e *ExpressRouteCrossConnection) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRouteCrossConnectionListResult. +func (e ExpressRouteCrossConnectionListResult) 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 ExpressRouteCrossConnectionListResult. +func (e *ExpressRouteCrossConnectionListResult) 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 ExpressRouteCrossConnectionPeering. +func (e ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionPeering. +func (e *ExpressRouteCrossConnectionPeering) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteCrossConnectionPeeringList. +func (e ExpressRouteCrossConnectionPeeringList) 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 ExpressRouteCrossConnectionPeeringList. +func (e *ExpressRouteCrossConnectionPeeringList) 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 ExpressRouteCrossConnectionPeeringProperties. +func (e ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureASN", e.AzureASN) + populate(objectMap, "gatewayManagerEtag", e.GatewayManagerEtag) + populate(objectMap, "ipv6PeeringConfig", e.IPv6PeeringConfig) + populate(objectMap, "lastModifiedBy", e.LastModifiedBy) + populate(objectMap, "microsoftPeeringConfig", e.MicrosoftPeeringConfig) + populate(objectMap, "peerASN", e.PeerASN) + populate(objectMap, "peeringType", e.PeeringType) + populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) + populate(objectMap, "primaryPeerAddressPrefix", e.PrimaryPeerAddressPrefix) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) + populate(objectMap, "secondaryPeerAddressPrefix", e.SecondaryPeerAddressPrefix) + populate(objectMap, "sharedKey", e.SharedKey) + populate(objectMap, "state", e.State) + populate(objectMap, "vlanId", e.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionPeeringProperties. +func (e *ExpressRouteCrossConnectionPeeringProperties) 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 "azureASN": + err = unpopulate(val, "AzureASN", &e.AzureASN) + delete(rawMsg, key) + case "gatewayManagerEtag": + err = unpopulate(val, "GatewayManagerEtag", &e.GatewayManagerEtag) + delete(rawMsg, key) + case "ipv6PeeringConfig": + err = unpopulate(val, "IPv6PeeringConfig", &e.IPv6PeeringConfig) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &e.LastModifiedBy) + delete(rawMsg, key) + case "microsoftPeeringConfig": + err = unpopulate(val, "MicrosoftPeeringConfig", &e.MicrosoftPeeringConfig) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &e.PeerASN) + delete(rawMsg, key) + case "peeringType": + err = unpopulate(val, "PeeringType", &e.PeeringType) + delete(rawMsg, key) + case "primaryAzurePort": + err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) + delete(rawMsg, key) + case "primaryPeerAddressPrefix": + err = unpopulate(val, "PrimaryPeerAddressPrefix", &e.PrimaryPeerAddressPrefix) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "secondaryAzurePort": + err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) + delete(rawMsg, key) + case "secondaryPeerAddressPrefix": + err = unpopulate(val, "SecondaryPeerAddressPrefix", &e.SecondaryPeerAddressPrefix) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &e.SharedKey) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &e.VlanID) + 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 ExpressRouteCrossConnectionProperties. +func (e ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bandwidthInMbps", e.BandwidthInMbps) + populate(objectMap, "expressRouteCircuit", e.ExpressRouteCircuit) + populate(objectMap, "peeringLocation", e.PeeringLocation) + populate(objectMap, "peerings", e.Peerings) + populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "sTag", e.STag) + populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) + populate(objectMap, "serviceProviderNotes", e.ServiceProviderNotes) + populate(objectMap, "serviceProviderProvisioningState", e.ServiceProviderProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionProperties. +func (e *ExpressRouteCrossConnectionProperties) 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 "bandwidthInMbps": + err = unpopulate(val, "BandwidthInMbps", &e.BandwidthInMbps) + delete(rawMsg, key) + case "expressRouteCircuit": + err = unpopulate(val, "ExpressRouteCircuit", &e.ExpressRouteCircuit) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) + delete(rawMsg, key) + case "peerings": + err = unpopulate(val, "Peerings", &e.Peerings) + delete(rawMsg, key) + case "primaryAzurePort": + err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "sTag": + err = unpopulate(val, "STag", &e.STag) + delete(rawMsg, key) + case "secondaryAzurePort": + err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) + delete(rawMsg, key) + case "serviceProviderNotes": + err = unpopulate(val, "ServiceProviderNotes", &e.ServiceProviderNotes) + delete(rawMsg, key) + case "serviceProviderProvisioningState": + err = unpopulate(val, "ServiceProviderProvisioningState", &e.ServiceProviderProvisioningState) + 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 ExpressRouteCrossConnectionRoutesTableSummary. +func (e ExpressRouteCrossConnectionRoutesTableSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asn", e.Asn) + populate(objectMap, "neighbor", e.Neighbor) + populate(objectMap, "stateOrPrefixesReceived", e.StateOrPrefixesReceived) + populate(objectMap, "upDown", e.UpDown) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteCrossConnectionRoutesTableSummary. +func (e *ExpressRouteCrossConnectionRoutesTableSummary) 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 "asn": + err = unpopulate(val, "Asn", &e.Asn) + delete(rawMsg, key) + case "neighbor": + err = unpopulate(val, "Neighbor", &e.Neighbor) + delete(rawMsg, key) + case "stateOrPrefixesReceived": + err = unpopulate(val, "StateOrPrefixesReceived", &e.StateOrPrefixesReceived) + delete(rawMsg, key) + case "upDown": + err = unpopulate(val, "UpDown", &e.UpDown) + 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 ExpressRouteCrossConnectionsRoutesTableSummaryListResult. +func (e ExpressRouteCrossConnectionsRoutesTableSummaryListResult) 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 ExpressRouteCrossConnectionsRoutesTableSummaryListResult. +func (e *ExpressRouteCrossConnectionsRoutesTableSummaryListResult) 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 ExpressRouteGateway. +func (e ExpressRouteGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGateway. +func (e *ExpressRouteGateway) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRouteGatewayList. +func (e ExpressRouteGatewayList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayList. +func (e *ExpressRouteGatewayList) 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 "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 ExpressRouteGatewayProperties. +func (e ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowNonVirtualWanTraffic", e.AllowNonVirtualWanTraffic) + populate(objectMap, "autoScaleConfiguration", e.AutoScaleConfiguration) + populate(objectMap, "expressRouteConnections", e.ExpressRouteConnections) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "virtualHub", e.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayProperties. +func (e *ExpressRouteGatewayProperties) 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 "allowNonVirtualWanTraffic": + err = unpopulate(val, "AllowNonVirtualWanTraffic", &e.AllowNonVirtualWanTraffic) + delete(rawMsg, key) + case "autoScaleConfiguration": + err = unpopulate(val, "AutoScaleConfiguration", &e.AutoScaleConfiguration) + delete(rawMsg, key) + case "expressRouteConnections": + err = unpopulate(val, "ExpressRouteConnections", &e.ExpressRouteConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &e.VirtualHub) + 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 ExpressRouteGatewayPropertiesAutoScaleConfiguration. +func (e ExpressRouteGatewayPropertiesAutoScaleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bounds", e.Bounds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfiguration. +func (e *ExpressRouteGatewayPropertiesAutoScaleConfiguration) 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 "bounds": + err = unpopulate(val, "Bounds", &e.Bounds) + 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 ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. +func (e ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "max", e.Max) + populate(objectMap, "min", e.Min) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. +func (e *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds) 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 "max": + err = unpopulate(val, "Max", &e.Max) + delete(rawMsg, key) + case "min": + err = unpopulate(val, "Min", &e.Min) + 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 ExpressRouteLink. +func (e ExpressRouteLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLink. +func (e *ExpressRouteLink) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRouteLinkListResult. +func (e ExpressRouteLinkListResult) 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 ExpressRouteLinkListResult. +func (e *ExpressRouteLinkListResult) 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 ExpressRouteLinkMacSecConfig. +func (e ExpressRouteLinkMacSecConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cakSecretIdentifier", e.CakSecretIdentifier) + populate(objectMap, "cipher", e.Cipher) + populate(objectMap, "cknSecretIdentifier", e.CknSecretIdentifier) + populate(objectMap, "sciState", e.SciState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkMacSecConfig. +func (e *ExpressRouteLinkMacSecConfig) 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 "cakSecretIdentifier": + err = unpopulate(val, "CakSecretIdentifier", &e.CakSecretIdentifier) + delete(rawMsg, key) + case "cipher": + err = unpopulate(val, "Cipher", &e.Cipher) + delete(rawMsg, key) + case "cknSecretIdentifier": + err = unpopulate(val, "CknSecretIdentifier", &e.CknSecretIdentifier) + delete(rawMsg, key) + case "sciState": + err = unpopulate(val, "SciState", &e.SciState) + 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 ExpressRouteLinkPropertiesFormat. +func (e ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminState", e.AdminState) + populate(objectMap, "coloLocation", e.ColoLocation) + populate(objectMap, "connectorType", e.ConnectorType) + populate(objectMap, "interfaceName", e.InterfaceName) + populate(objectMap, "macSecConfig", e.MacSecConfig) + populate(objectMap, "patchPanelId", e.PatchPanelID) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "rackId", e.RackID) + populate(objectMap, "routerName", e.RouterName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteLinkPropertiesFormat. +func (e *ExpressRouteLinkPropertiesFormat) 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 "adminState": + err = unpopulate(val, "AdminState", &e.AdminState) + delete(rawMsg, key) + case "coloLocation": + err = unpopulate(val, "ColoLocation", &e.ColoLocation) + delete(rawMsg, key) + case "connectorType": + err = unpopulate(val, "ConnectorType", &e.ConnectorType) + delete(rawMsg, key) + case "interfaceName": + err = unpopulate(val, "InterfaceName", &e.InterfaceName) + delete(rawMsg, key) + case "macSecConfig": + err = unpopulate(val, "MacSecConfig", &e.MacSecConfig) + delete(rawMsg, key) + case "patchPanelId": + err = unpopulate(val, "PatchPanelID", &e.PatchPanelID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "rackId": + err = unpopulate(val, "RackID", &e.RackID) + delete(rawMsg, key) + case "routerName": + err = unpopulate(val, "RouterName", &e.RouterName) + 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 ExpressRoutePort. +func (e ExpressRoutePort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "identity", e.Identity) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePort. +func (e *ExpressRoutePort) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRoutePortAuthorization. +func (e ExpressRoutePortAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortAuthorization. +func (e *ExpressRoutePortAuthorization) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExpressRoutePortAuthorizationListResult. +func (e ExpressRoutePortAuthorizationListResult) 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 ExpressRoutePortAuthorizationListResult. +func (e *ExpressRoutePortAuthorizationListResult) 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 ExpressRoutePortAuthorizationPropertiesFormat. +func (e ExpressRoutePortAuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationKey", e.AuthorizationKey) + populate(objectMap, "authorizationUseStatus", e.AuthorizationUseStatus) + populate(objectMap, "circuitResourceUri", e.CircuitResourceURI) + populate(objectMap, "provisioningState", e.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortAuthorizationPropertiesFormat. +func (e *ExpressRoutePortAuthorizationPropertiesFormat) 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 "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &e.AuthorizationKey) + delete(rawMsg, key) + case "authorizationUseStatus": + err = unpopulate(val, "AuthorizationUseStatus", &e.AuthorizationUseStatus) + delete(rawMsg, key) + case "circuitResourceUri": + err = unpopulate(val, "CircuitResourceURI", &e.CircuitResourceURI) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + 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 ExpressRoutePortListResult. +func (e ExpressRoutePortListResult) 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 ExpressRoutePortListResult. +func (e *ExpressRoutePortListResult) 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 ExpressRoutePortPropertiesFormat. +func (e ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocationDate", e.AllocationDate) + populate(objectMap, "bandwidthInGbps", e.BandwidthInGbps) + populate(objectMap, "billingType", e.BillingType) + populate(objectMap, "circuits", e.Circuits) + populate(objectMap, "encapsulation", e.Encapsulation) + populate(objectMap, "etherType", e.EtherType) + populate(objectMap, "links", e.Links) + populate(objectMap, "mtu", e.Mtu) + populate(objectMap, "peeringLocation", e.PeeringLocation) + populate(objectMap, "provisionedBandwidthInGbps", e.ProvisionedBandwidthInGbps) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "resourceGuid", e.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortPropertiesFormat. +func (e *ExpressRoutePortPropertiesFormat) 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 "allocationDate": + err = unpopulate(val, "AllocationDate", &e.AllocationDate) + delete(rawMsg, key) + case "bandwidthInGbps": + err = unpopulate(val, "BandwidthInGbps", &e.BandwidthInGbps) + delete(rawMsg, key) + case "billingType": + err = unpopulate(val, "BillingType", &e.BillingType) + delete(rawMsg, key) + case "circuits": + err = unpopulate(val, "Circuits", &e.Circuits) + delete(rawMsg, key) + case "encapsulation": + err = unpopulate(val, "Encapsulation", &e.Encapsulation) + delete(rawMsg, key) + case "etherType": + err = unpopulate(val, "EtherType", &e.EtherType) + delete(rawMsg, key) + case "links": + err = unpopulate(val, "Links", &e.Links) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &e.Mtu) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) + delete(rawMsg, key) + case "provisionedBandwidthInGbps": + err = unpopulate(val, "ProvisionedBandwidthInGbps", &e.ProvisionedBandwidthInGbps) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &e.ResourceGUID) + 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 ExpressRoutePortsLocation. +func (e ExpressRoutePortsLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocation. +func (e *ExpressRoutePortsLocation) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRoutePortsLocationBandwidths. +func (e ExpressRoutePortsLocationBandwidths) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offerName", e.OfferName) + populate(objectMap, "valueInGbps", e.ValueInGbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocationBandwidths. +func (e *ExpressRoutePortsLocationBandwidths) 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 "offerName": + err = unpopulate(val, "OfferName", &e.OfferName) + delete(rawMsg, key) + case "valueInGbps": + err = unpopulate(val, "ValueInGbps", &e.ValueInGbps) + 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 ExpressRoutePortsLocationListResult. +func (e ExpressRoutePortsLocationListResult) 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 ExpressRoutePortsLocationListResult. +func (e *ExpressRoutePortsLocationListResult) 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 ExpressRoutePortsLocationPropertiesFormat. +func (e ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", e.Address) + populate(objectMap, "availableBandwidths", e.AvailableBandwidths) + populate(objectMap, "contact", e.Contact) + populate(objectMap, "provisioningState", e.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRoutePortsLocationPropertiesFormat. +func (e *ExpressRoutePortsLocationPropertiesFormat) 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 "address": + err = unpopulate(val, "Address", &e.Address) + delete(rawMsg, key) + case "availableBandwidths": + err = unpopulate(val, "AvailableBandwidths", &e.AvailableBandwidths) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &e.Contact) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + 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 ExpressRouteProviderPort. +func (e ExpressRouteProviderPort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteProviderPort. +func (e *ExpressRouteProviderPort) 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 "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRouteProviderPortListResult. +func (e ExpressRouteProviderPortListResult) 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 ExpressRouteProviderPortListResult. +func (e *ExpressRouteProviderPortListResult) 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 ExpressRouteProviderPortProperties. +func (e ExpressRouteProviderPortProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "overprovisionFactor", e.OverprovisionFactor) + populate(objectMap, "peeringLocation", e.PeeringLocation) + populate(objectMap, "portBandwidthInMbps", e.PortBandwidthInMbps) + populate(objectMap, "portPairDescriptor", e.PortPairDescriptor) + populate(objectMap, "primaryAzurePort", e.PrimaryAzurePort) + populate(objectMap, "remainingBandwidthInMbps", e.RemainingBandwidthInMbps) + populate(objectMap, "secondaryAzurePort", e.SecondaryAzurePort) + populate(objectMap, "usedBandwidthInMbps", e.UsedBandwidthInMbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteProviderPortProperties. +func (e *ExpressRouteProviderPortProperties) 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 "overprovisionFactor": + err = unpopulate(val, "OverprovisionFactor", &e.OverprovisionFactor) + delete(rawMsg, key) + case "peeringLocation": + err = unpopulate(val, "PeeringLocation", &e.PeeringLocation) + delete(rawMsg, key) + case "portBandwidthInMbps": + err = unpopulate(val, "PortBandwidthInMbps", &e.PortBandwidthInMbps) + delete(rawMsg, key) + case "portPairDescriptor": + err = unpopulate(val, "PortPairDescriptor", &e.PortPairDescriptor) + delete(rawMsg, key) + case "primaryAzurePort": + err = unpopulate(val, "PrimaryAzurePort", &e.PrimaryAzurePort) + delete(rawMsg, key) + case "remainingBandwidthInMbps": + err = unpopulate(val, "RemainingBandwidthInMbps", &e.RemainingBandwidthInMbps) + delete(rawMsg, key) + case "secondaryAzurePort": + err = unpopulate(val, "SecondaryAzurePort", &e.SecondaryAzurePort) + delete(rawMsg, key) + case "usedBandwidthInMbps": + err = unpopulate(val, "UsedBandwidthInMbps", &e.UsedBandwidthInMbps) + 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 ExpressRouteServiceProvider. +func (e ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProvider. +func (e *ExpressRouteServiceProvider) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ExpressRouteServiceProviderBandwidthsOffered. +func (e ExpressRouteServiceProviderBandwidthsOffered) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offerName", e.OfferName) + populate(objectMap, "valueInMbps", e.ValueInMbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProviderBandwidthsOffered. +func (e *ExpressRouteServiceProviderBandwidthsOffered) 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 "offerName": + err = unpopulate(val, "OfferName", &e.OfferName) + delete(rawMsg, key) + case "valueInMbps": + err = unpopulate(val, "ValueInMbps", &e.ValueInMbps) + 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 ExpressRouteServiceProviderListResult. +func (e ExpressRouteServiceProviderListResult) 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 ExpressRouteServiceProviderListResult. +func (e *ExpressRouteServiceProviderListResult) 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 ExpressRouteServiceProviderPropertiesFormat. +func (e ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bandwidthsOffered", e.BandwidthsOffered) + populate(objectMap, "peeringLocations", e.PeeringLocations) + populate(objectMap, "provisioningState", e.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteServiceProviderPropertiesFormat. +func (e *ExpressRouteServiceProviderPropertiesFormat) 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 "bandwidthsOffered": + err = unpopulate(val, "BandwidthsOffered", &e.BandwidthsOffered) + delete(rawMsg, key) + case "peeringLocations": + err = unpopulate(val, "PeeringLocations", &e.PeeringLocations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + 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 FilterItems. +func (f FilterItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "field", f.Field) + populate(objectMap, "values", f.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FilterItems. +func (f *FilterItems) 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 "field": + err = unpopulate(val, "Field", &f.Field) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &f.Values) + 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 FirewallPolicy. +func (f FirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "id", f.ID) + populate(objectMap, "identity", f.Identity) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicy. +func (f *FirewallPolicy) 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 "identity": + err = unpopulate(val, "Identity", &f.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &f.Location) + 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 "tags": + err = unpopulate(val, "Tags", &f.Tags) + 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 FirewallPolicyCertificateAuthority. +func (f FirewallPolicyCertificateAuthority) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyVaultSecretId", f.KeyVaultSecretID) + populate(objectMap, "name", f.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyCertificateAuthority. +func (f *FirewallPolicyCertificateAuthority) 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 "keyVaultSecretId": + err = unpopulate(val, "KeyVaultSecretID", &f.KeyVaultSecretID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + 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 FirewallPolicyFilterRuleCollection. +func (f FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", f.Action) + populate(objectMap, "name", f.Name) + populate(objectMap, "priority", f.Priority) + objectMap["ruleCollectionType"] = FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection + populate(objectMap, "rules", f.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyFilterRuleCollection. +func (f *FirewallPolicyFilterRuleCollection) 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 "action": + err = unpopulate(val, "Action", &f.Action) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &f.Priority) + delete(rawMsg, key) + case "ruleCollectionType": + err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) + delete(rawMsg, key) + case "rules": + f.Rules, err = unmarshalFirewallPolicyRuleClassificationArray(val) + 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 FirewallPolicyFilterRuleCollectionAction. +func (f FirewallPolicyFilterRuleCollectionAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyFilterRuleCollectionAction. +func (f *FirewallPolicyFilterRuleCollectionAction) 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 "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 FirewallPolicyInsights. +func (f FirewallPolicyInsights) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isEnabled", f.IsEnabled) + populate(objectMap, "logAnalyticsResources", f.LogAnalyticsResources) + populate(objectMap, "retentionDays", f.RetentionDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyInsights. +func (f *FirewallPolicyInsights) 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 "isEnabled": + err = unpopulate(val, "IsEnabled", &f.IsEnabled) + delete(rawMsg, key) + case "logAnalyticsResources": + err = unpopulate(val, "LogAnalyticsResources", &f.LogAnalyticsResources) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &f.RetentionDays) + 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 FirewallPolicyIntrusionDetection. +func (f FirewallPolicyIntrusionDetection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", f.Configuration) + populate(objectMap, "mode", f.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetection. +func (f *FirewallPolicyIntrusionDetection) 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 "configuration": + err = unpopulate(val, "Configuration", &f.Configuration) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &f.Mode) + 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 FirewallPolicyIntrusionDetectionBypassTrafficSpecifications. +func (f FirewallPolicyIntrusionDetectionBypassTrafficSpecifications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", f.Description) + populate(objectMap, "destinationAddresses", f.DestinationAddresses) + populate(objectMap, "destinationIpGroups", f.DestinationIPGroups) + populate(objectMap, "destinationPorts", f.DestinationPorts) + populate(objectMap, "name", f.Name) + populate(objectMap, "protocol", f.Protocol) + populate(objectMap, "sourceAddresses", f.SourceAddresses) + populate(objectMap, "sourceIpGroups", f.SourceIPGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications. +func (f *FirewallPolicyIntrusionDetectionBypassTrafficSpecifications) 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 "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &f.DestinationAddresses) + delete(rawMsg, key) + case "destinationIpGroups": + err = unpopulate(val, "DestinationIPGroups", &f.DestinationIPGroups) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &f.DestinationPorts) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &f.Protocol) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &f.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &f.SourceIPGroups) + 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 FirewallPolicyIntrusionDetectionConfiguration. +func (f FirewallPolicyIntrusionDetectionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bypassTrafficSettings", f.BypassTrafficSettings) + populate(objectMap, "privateRanges", f.PrivateRanges) + populate(objectMap, "signatureOverrides", f.SignatureOverrides) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionConfiguration. +func (f *FirewallPolicyIntrusionDetectionConfiguration) 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 "bypassTrafficSettings": + err = unpopulate(val, "BypassTrafficSettings", &f.BypassTrafficSettings) + delete(rawMsg, key) + case "privateRanges": + err = unpopulate(val, "PrivateRanges", &f.PrivateRanges) + delete(rawMsg, key) + case "signatureOverrides": + err = unpopulate(val, "SignatureOverrides", &f.SignatureOverrides) + 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 FirewallPolicyIntrusionDetectionSignatureSpecification. +func (f FirewallPolicyIntrusionDetectionSignatureSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "mode", f.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyIntrusionDetectionSignatureSpecification. +func (f *FirewallPolicyIntrusionDetectionSignatureSpecification) 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 "mode": + err = unpopulate(val, "Mode", &f.Mode) + 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 FirewallPolicyListResult. +func (f FirewallPolicyListResult) 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 FirewallPolicyListResult. +func (f *FirewallPolicyListResult) 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 FirewallPolicyLogAnalyticsResources. +func (f FirewallPolicyLogAnalyticsResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultWorkspaceId", f.DefaultWorkspaceID) + populate(objectMap, "workspaces", f.Workspaces) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyLogAnalyticsResources. +func (f *FirewallPolicyLogAnalyticsResources) 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 "defaultWorkspaceId": + err = unpopulate(val, "DefaultWorkspaceID", &f.DefaultWorkspaceID) + delete(rawMsg, key) + case "workspaces": + err = unpopulate(val, "Workspaces", &f.Workspaces) + 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 FirewallPolicyLogAnalyticsWorkspace. +func (f FirewallPolicyLogAnalyticsWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "region", f.Region) + populate(objectMap, "workspaceId", f.WorkspaceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyLogAnalyticsWorkspace. +func (f *FirewallPolicyLogAnalyticsWorkspace) 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 "region": + err = unpopulate(val, "Region", &f.Region) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &f.WorkspaceID) + 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 FirewallPolicyNatRuleCollection. +func (f FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", f.Action) + populate(objectMap, "name", f.Name) + populate(objectMap, "priority", f.Priority) + objectMap["ruleCollectionType"] = FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection + populate(objectMap, "rules", f.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyNatRuleCollection. +func (f *FirewallPolicyNatRuleCollection) 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 "action": + err = unpopulate(val, "Action", &f.Action) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &f.Priority) + delete(rawMsg, key) + case "ruleCollectionType": + err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) + delete(rawMsg, key) + case "rules": + f.Rules, err = unmarshalFirewallPolicyRuleClassificationArray(val) + 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 FirewallPolicyNatRuleCollectionAction. +func (f FirewallPolicyNatRuleCollectionAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyNatRuleCollectionAction. +func (f *FirewallPolicyNatRuleCollectionAction) 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 "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 FirewallPolicyPropertiesFormat. +func (f FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "basePolicy", f.BasePolicy) + populate(objectMap, "childPolicies", f.ChildPolicies) + populate(objectMap, "dnsSettings", f.DNSSettings) + populate(objectMap, "explicitProxySettings", f.ExplicitProxySettings) + populate(objectMap, "firewalls", f.Firewalls) + populate(objectMap, "insights", f.Insights) + populate(objectMap, "intrusionDetection", f.IntrusionDetection) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "ruleCollectionGroups", f.RuleCollectionGroups) + populate(objectMap, "sku", f.SKU) + populate(objectMap, "sql", f.SQL) + populate(objectMap, "snat", f.Snat) + populate(objectMap, "threatIntelMode", f.ThreatIntelMode) + populate(objectMap, "threatIntelWhitelist", f.ThreatIntelWhitelist) + populate(objectMap, "transportSecurity", f.TransportSecurity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyPropertiesFormat. +func (f *FirewallPolicyPropertiesFormat) 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 "basePolicy": + err = unpopulate(val, "BasePolicy", &f.BasePolicy) + delete(rawMsg, key) + case "childPolicies": + err = unpopulate(val, "ChildPolicies", &f.ChildPolicies) + delete(rawMsg, key) + case "dnsSettings": + err = unpopulate(val, "DNSSettings", &f.DNSSettings) + delete(rawMsg, key) + case "explicitProxySettings": + err = unpopulate(val, "ExplicitProxySettings", &f.ExplicitProxySettings) + delete(rawMsg, key) + case "firewalls": + err = unpopulate(val, "Firewalls", &f.Firewalls) + delete(rawMsg, key) + case "insights": + err = unpopulate(val, "Insights", &f.Insights) + delete(rawMsg, key) + case "intrusionDetection": + err = unpopulate(val, "IntrusionDetection", &f.IntrusionDetection) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "ruleCollectionGroups": + err = unpopulate(val, "RuleCollectionGroups", &f.RuleCollectionGroups) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &f.SKU) + delete(rawMsg, key) + case "sql": + err = unpopulate(val, "SQL", &f.SQL) + delete(rawMsg, key) + case "snat": + err = unpopulate(val, "Snat", &f.Snat) + delete(rawMsg, key) + case "threatIntelMode": + err = unpopulate(val, "ThreatIntelMode", &f.ThreatIntelMode) + delete(rawMsg, key) + case "threatIntelWhitelist": + err = unpopulate(val, "ThreatIntelWhitelist", &f.ThreatIntelWhitelist) + delete(rawMsg, key) + case "transportSecurity": + err = unpopulate(val, "TransportSecurity", &f.TransportSecurity) + 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 FirewallPolicyRule. +func (f FirewallPolicyRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", f.Description) + populate(objectMap, "name", f.Name) + objectMap["ruleType"] = f.RuleType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRule. +func (f *FirewallPolicyRule) 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 "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &f.RuleType) + 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 FirewallPolicyRuleApplicationProtocol. +func (f FirewallPolicyRuleApplicationProtocol) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", f.Port) + populate(objectMap, "protocolType", f.ProtocolType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleApplicationProtocol. +func (f *FirewallPolicyRuleApplicationProtocol) 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 "port": + err = unpopulate(val, "Port", &f.Port) + delete(rawMsg, key) + case "protocolType": + err = unpopulate(val, "ProtocolType", &f.ProtocolType) + 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 FirewallPolicyRuleCollection. +func (f FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", f.Name) + populate(objectMap, "priority", f.Priority) + objectMap["ruleCollectionType"] = f.RuleCollectionType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollection. +func (f *FirewallPolicyRuleCollection) 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 "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &f.Priority) + delete(rawMsg, key) + case "ruleCollectionType": + err = unpopulate(val, "RuleCollectionType", &f.RuleCollectionType) + 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 FirewallPolicyRuleCollectionGroup. +func (f FirewallPolicyRuleCollectionGroup) 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 FirewallPolicyRuleCollectionGroup. +func (f *FirewallPolicyRuleCollectionGroup) 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 FirewallPolicyRuleCollectionGroupListResult. +func (f FirewallPolicyRuleCollectionGroupListResult) 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 FirewallPolicyRuleCollectionGroupListResult. +func (f *FirewallPolicyRuleCollectionGroupListResult) 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 FirewallPolicyRuleCollectionGroupProperties. +func (f FirewallPolicyRuleCollectionGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "priority", f.Priority) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "ruleCollections", f.RuleCollections) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyRuleCollectionGroupProperties. +func (f *FirewallPolicyRuleCollectionGroupProperties) 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 "priority": + err = unpopulate(val, "Priority", &f.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "ruleCollections": + f.RuleCollections, err = unmarshalFirewallPolicyRuleCollectionClassificationArray(val) + 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 FirewallPolicySKU. +func (f FirewallPolicySKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tier", f.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySKU. +func (f *FirewallPolicySKU) 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 "tier": + err = unpopulate(val, "Tier", &f.Tier) + 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 FirewallPolicySNAT. +func (f FirewallPolicySNAT) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoLearnPrivateRanges", f.AutoLearnPrivateRanges) + populate(objectMap, "privateRanges", f.PrivateRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySNAT. +func (f *FirewallPolicySNAT) 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 "autoLearnPrivateRanges": + err = unpopulate(val, "AutoLearnPrivateRanges", &f.AutoLearnPrivateRanges) + delete(rawMsg, key) + case "privateRanges": + err = unpopulate(val, "PrivateRanges", &f.PrivateRanges) + 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 FirewallPolicySQL. +func (f FirewallPolicySQL) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowSqlRedirect", f.AllowSQLRedirect) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicySQL. +func (f *FirewallPolicySQL) 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 "allowSqlRedirect": + err = unpopulate(val, "AllowSQLRedirect", &f.AllowSQLRedirect) + 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 FirewallPolicyThreatIntelWhitelist. +func (f FirewallPolicyThreatIntelWhitelist) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdns", f.Fqdns) + populate(objectMap, "ipAddresses", f.IPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyThreatIntelWhitelist. +func (f *FirewallPolicyThreatIntelWhitelist) 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 "fqdns": + err = unpopulate(val, "Fqdns", &f.Fqdns) + delete(rawMsg, key) + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &f.IPAddresses) + 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 FirewallPolicyTransportSecurity. +func (f FirewallPolicyTransportSecurity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateAuthority", f.CertificateAuthority) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallPolicyTransportSecurity. +func (f *FirewallPolicyTransportSecurity) 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 "certificateAuthority": + err = unpopulate(val, "CertificateAuthority", &f.CertificateAuthority) + 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 FlowLog. +func (f FlowLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "id", f.ID) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLog. +func (f *FlowLog) 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 "location": + err = unpopulate(val, "Location", &f.Location) + 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 "tags": + err = unpopulate(val, "Tags", &f.Tags) + 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 FlowLogFormatParameters. +func (f FlowLogFormatParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", f.Type) + populate(objectMap, "version", f.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogFormatParameters. +func (f *FlowLogFormatParameters) 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 "type": + err = unpopulate(val, "Type", &f.Type) + 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 FlowLogInformation. +func (f FlowLogInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "flowAnalyticsConfiguration", f.FlowAnalyticsConfiguration) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "targetResourceId", f.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogInformation. +func (f *FlowLogInformation) 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 "flowAnalyticsConfiguration": + err = unpopulate(val, "FlowAnalyticsConfiguration", &f.FlowAnalyticsConfiguration) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) + 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 FlowLogListResult. +func (f FlowLogListResult) 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 FlowLogListResult. +func (f *FlowLogListResult) 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 FlowLogProperties. +func (f FlowLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "format", f.Format) + populate(objectMap, "retentionPolicy", f.RetentionPolicy) + populate(objectMap, "storageId", f.StorageID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogProperties. +func (f *FlowLogProperties) 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 "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &f.Format) + delete(rawMsg, key) + case "retentionPolicy": + err = unpopulate(val, "RetentionPolicy", &f.RetentionPolicy) + delete(rawMsg, key) + case "storageId": + err = unpopulate(val, "StorageID", &f.StorageID) + 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 FlowLogPropertiesFormat. +func (f FlowLogPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "flowAnalyticsConfiguration", f.FlowAnalyticsConfiguration) + populate(objectMap, "format", f.Format) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "retentionPolicy", f.RetentionPolicy) + populate(objectMap, "storageId", f.StorageID) + populate(objectMap, "targetResourceGuid", f.TargetResourceGUID) + populate(objectMap, "targetResourceId", f.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogPropertiesFormat. +func (f *FlowLogPropertiesFormat) 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 "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) + delete(rawMsg, key) + case "flowAnalyticsConfiguration": + err = unpopulate(val, "FlowAnalyticsConfiguration", &f.FlowAnalyticsConfiguration) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &f.Format) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "retentionPolicy": + err = unpopulate(val, "RetentionPolicy", &f.RetentionPolicy) + delete(rawMsg, key) + case "storageId": + err = unpopulate(val, "StorageID", &f.StorageID) + delete(rawMsg, key) + case "targetResourceGuid": + err = unpopulate(val, "TargetResourceGUID", &f.TargetResourceGUID) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) + 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 FlowLogStatusParameters. +func (f FlowLogStatusParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetResourceId", f.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlowLogStatusParameters. +func (f *FlowLogStatusParameters) 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 "targetResourceId": + err = unpopulate(val, "TargetResourceID", &f.TargetResourceID) + 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 FrontendIPConfiguration. +func (f FrontendIPConfiguration) 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) + populate(objectMap, "zones", f.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontendIPConfiguration. +func (f *FrontendIPConfiguration) 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) + case "zones": + err = unpopulate(val, "Zones", &f.Zones) + 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 FrontendIPConfigurationPropertiesFormat. +func (f FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gatewayLoadBalancer", f.GatewayLoadBalancer) + populate(objectMap, "inboundNatPools", f.InboundNatPools) + populate(objectMap, "inboundNatRules", f.InboundNatRules) + populate(objectMap, "loadBalancingRules", f.LoadBalancingRules) + populate(objectMap, "outboundRules", f.OutboundRules) + populate(objectMap, "privateIPAddress", f.PrivateIPAddress) + populate(objectMap, "privateIPAddressVersion", f.PrivateIPAddressVersion) + populate(objectMap, "privateIPAllocationMethod", f.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "publicIPAddress", f.PublicIPAddress) + populate(objectMap, "publicIPPrefix", f.PublicIPPrefix) + populate(objectMap, "subnet", f.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontendIPConfigurationPropertiesFormat. +func (f *FrontendIPConfigurationPropertiesFormat) 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 "gatewayLoadBalancer": + err = unpopulate(val, "GatewayLoadBalancer", &f.GatewayLoadBalancer) + delete(rawMsg, key) + case "inboundNatPools": + err = unpopulate(val, "InboundNatPools", &f.InboundNatPools) + delete(rawMsg, key) + case "inboundNatRules": + err = unpopulate(val, "InboundNatRules", &f.InboundNatRules) + delete(rawMsg, key) + case "loadBalancingRules": + err = unpopulate(val, "LoadBalancingRules", &f.LoadBalancingRules) + delete(rawMsg, key) + case "outboundRules": + err = unpopulate(val, "OutboundRules", &f.OutboundRules) + delete(rawMsg, key) + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &f.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAddressVersion": + err = unpopulate(val, "PrivateIPAddressVersion", &f.PrivateIPAddressVersion) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &f.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &f.PublicIPAddress) + delete(rawMsg, key) + case "publicIPPrefix": + err = unpopulate(val, "PublicIPPrefix", &f.PublicIPPrefix) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &f.Subnet) + 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 GatewayCustomBgpIPAddressIPConfiguration. +func (g GatewayCustomBgpIPAddressIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customBgpIpAddress", g.CustomBgpIPAddress) + populate(objectMap, "ipConfigurationId", g.IPConfigurationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCustomBgpIPAddressIPConfiguration. +func (g *GatewayCustomBgpIPAddressIPConfiguration) 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 "customBgpIpAddress": + err = unpopulate(val, "CustomBgpIPAddress", &g.CustomBgpIPAddress) + delete(rawMsg, key) + case "ipConfigurationId": + err = unpopulate(val, "IPConfigurationID", &g.IPConfigurationID) + 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 GatewayLoadBalancerTunnelInterface. +func (g GatewayLoadBalancerTunnelInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identifier", g.Identifier) + populate(objectMap, "port", g.Port) + populate(objectMap, "protocol", g.Protocol) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayLoadBalancerTunnelInterface. +func (g *GatewayLoadBalancerTunnelInterface) 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 "identifier": + err = unpopulate(val, "Identifier", &g.Identifier) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &g.Port) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &g.Protocol) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + 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 GatewayRoute. +func (g GatewayRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asPath", g.AsPath) + populate(objectMap, "localAddress", g.LocalAddress) + populate(objectMap, "network", g.Network) + populate(objectMap, "nextHop", g.NextHop) + populate(objectMap, "origin", g.Origin) + populate(objectMap, "sourcePeer", g.SourcePeer) + populate(objectMap, "weight", g.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRoute. +func (g *GatewayRoute) 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 "asPath": + err = unpopulate(val, "AsPath", &g.AsPath) + delete(rawMsg, key) + case "localAddress": + err = unpopulate(val, "LocalAddress", &g.LocalAddress) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &g.Network) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &g.NextHop) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &g.Origin) + delete(rawMsg, key) + case "sourcePeer": + err = unpopulate(val, "SourcePeer", &g.SourcePeer) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &g.Weight) + 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 GatewayRouteListResult. +func (g GatewayRouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteListResult. +func (g *GatewayRouteListResult) 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 "value": + err = unpopulate(val, "Value", &g.Value) + 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 GenerateExpressRoutePortsLOARequest. +func (g GenerateExpressRoutePortsLOARequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customerName", g.CustomerName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOARequest. +func (g *GenerateExpressRoutePortsLOARequest) 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 "customerName": + err = unpopulate(val, "CustomerName", &g.CustomerName) + 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 GenerateExpressRoutePortsLOAResult. +func (g GenerateExpressRoutePortsLOAResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encodedContent", g.EncodedContent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOAResult. +func (g *GenerateExpressRoutePortsLOAResult) 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 "encodedContent": + err = unpopulate(val, "EncodedContent", &g.EncodedContent) + 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 GetInboundRoutesParameters. +func (g GetInboundRoutesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionType", g.ConnectionType) + populate(objectMap, "resourceUri", g.ResourceURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetInboundRoutesParameters. +func (g *GetInboundRoutesParameters) 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 "connectionType": + err = unpopulate(val, "ConnectionType", &g.ConnectionType) + delete(rawMsg, key) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &g.ResourceURI) + 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 GetOutboundRoutesParameters. +func (g GetOutboundRoutesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionType", g.ConnectionType) + populate(objectMap, "resourceUri", g.ResourceURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetOutboundRoutesParameters. +func (g *GetOutboundRoutesParameters) 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 "connectionType": + err = unpopulate(val, "ConnectionType", &g.ConnectionType) + delete(rawMsg, key) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &g.ResourceURI) + 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 GetVPNSitesConfigurationRequest. +func (g GetVPNSitesConfigurationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "outputBlobSasUrl", g.OutputBlobSasURL) + populate(objectMap, "vpnSites", g.VPNSites) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetVPNSitesConfigurationRequest. +func (g *GetVPNSitesConfigurationRequest) 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 "outputBlobSasUrl": + err = unpopulate(val, "OutputBlobSasURL", &g.OutputBlobSasURL) + delete(rawMsg, key) + case "vpnSites": + err = unpopulate(val, "VPNSites", &g.VPNSites) + 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 Group. +func (g Group) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", g.Etag) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Group. +func (g *Group) 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 "etag": + err = unpopulate(val, "Etag", &g.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + 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 GroupListResult. +func (g GroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupListResult. +func (g *GroupListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + 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 GroupProperties. +func (g GroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "provisioningState", g.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupProperties. +func (g *GroupProperties) 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 "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + 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 HTTPConfiguration. +func (h HTTPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", h.Headers) + populate(objectMap, "method", h.Method) + populate(objectMap, "validStatusCodes", h.ValidStatusCodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPConfiguration. +func (h *HTTPConfiguration) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "headers": + err = unpopulate(val, "Headers", &h.Headers) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &h.Method) + delete(rawMsg, key) + case "validStatusCodes": + err = unpopulate(val, "ValidStatusCodes", &h.ValidStatusCodes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPHeader. +func (h HTTPHeader) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", h.Name) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader. +func (h *HTTPHeader) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HopLink. +func (h HopLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "context", h.Context) + populate(objectMap, "issues", h.Issues) + populate(objectMap, "linkType", h.LinkType) + populate(objectMap, "nextHopId", h.NextHopID) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "resourceId", h.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HopLink. +func (h *HopLink) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "context": + err = unpopulate(val, "Context", &h.Context) + delete(rawMsg, key) + case "issues": + err = unpopulate(val, "Issues", &h.Issues) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &h.LinkType) + delete(rawMsg, key) + case "nextHopId": + err = unpopulate(val, "NextHopID", &h.NextHopID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HopLinkProperties. +func (h HopLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "roundTripTimeAvg", h.RoundTripTimeAvg) + populate(objectMap, "roundTripTimeMax", h.RoundTripTimeMax) + populate(objectMap, "roundTripTimeMin", h.RoundTripTimeMin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HopLinkProperties. +func (h *HopLinkProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "roundTripTimeAvg": + err = unpopulate(val, "RoundTripTimeAvg", &h.RoundTripTimeAvg) + delete(rawMsg, key) + case "roundTripTimeMax": + err = unpopulate(val, "RoundTripTimeMax", &h.RoundTripTimeMax) + delete(rawMsg, key) + case "roundTripTimeMin": + err = unpopulate(val, "RoundTripTimeMin", &h.RoundTripTimeMin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Hub. +func (h Hub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", h.ResourceID) + populate(objectMap, "resourceType", h.ResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Hub. +func (h *Hub) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &h.ResourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubIPAddresses. +func (h HubIPAddresses) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", h.PrivateIPAddress) + populate(objectMap, "publicIPs", h.PublicIPs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPAddresses. +func (h *HubIPAddresses) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &h.PrivateIPAddress) + delete(rawMsg, key) + case "publicIPs": + err = unpopulate(val, "PublicIPs", &h.PublicIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubIPConfiguration. +func (h HubIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPConfiguration. +func (h *HubIPConfiguration) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &h.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubIPConfigurationPropertiesFormat. +func (h HubIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", h.PrivateIPAddress) + populate(objectMap, "privateIPAllocationMethod", h.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", h.ProvisioningState) + populate(objectMap, "publicIPAddress", h.PublicIPAddress) + populate(objectMap, "subnet", h.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubIPConfigurationPropertiesFormat. +func (h *HubIPConfigurationPropertiesFormat) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &h.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &h.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &h.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &h.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubPublicIPAddresses. +func (h HubPublicIPAddresses) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addresses", h.Addresses) + populate(objectMap, "count", h.Count) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubPublicIPAddresses. +func (h *HubPublicIPAddresses) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addresses": + err = unpopulate(val, "Addresses", &h.Addresses) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &h.Count) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubRoute. +func (h HubRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationType", h.DestinationType) + populate(objectMap, "destinations", h.Destinations) + populate(objectMap, "name", h.Name) + populate(objectMap, "nextHop", h.NextHop) + populate(objectMap, "nextHopType", h.NextHopType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubRoute. +func (h *HubRoute) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationType": + err = unpopulate(val, "DestinationType", &h.DestinationType) + delete(rawMsg, key) + case "destinations": + err = unpopulate(val, "Destinations", &h.Destinations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &h.NextHop) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &h.NextHopType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubRouteTable. +func (h HubRouteTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubRouteTable. +func (h *HubRouteTable) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &h.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubRouteTableProperties. +func (h HubRouteTableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedConnections", h.AssociatedConnections) + populate(objectMap, "labels", h.Labels) + populate(objectMap, "propagatingConnections", h.PropagatingConnections) + populate(objectMap, "provisioningState", h.ProvisioningState) + populate(objectMap, "routes", h.Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubRouteTableProperties. +func (h *HubRouteTableProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "associatedConnections": + err = unpopulate(val, "AssociatedConnections", &h.AssociatedConnections) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &h.Labels) + delete(rawMsg, key) + case "propagatingConnections": + err = unpopulate(val, "PropagatingConnections", &h.PropagatingConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &h.Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubVirtualNetworkConnection. +func (h HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubVirtualNetworkConnection. +func (h *HubVirtualNetworkConnection) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &h.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HubVirtualNetworkConnectionProperties. +func (h HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowHubToRemoteVnetTransit", h.AllowHubToRemoteVnetTransit) + populate(objectMap, "allowRemoteVnetToUseHubVnetGateways", h.AllowRemoteVnetToUseHubVnetGateways) + populate(objectMap, "enableInternetSecurity", h.EnableInternetSecurity) + populate(objectMap, "provisioningState", h.ProvisioningState) + populate(objectMap, "remoteVirtualNetwork", h.RemoteVirtualNetwork) + populate(objectMap, "routingConfiguration", h.RoutingConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HubVirtualNetworkConnectionProperties. +func (h *HubVirtualNetworkConnectionProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowHubToRemoteVnetTransit": + err = unpopulate(val, "AllowHubToRemoteVnetTransit", &h.AllowHubToRemoteVnetTransit) + delete(rawMsg, key) + case "allowRemoteVnetToUseHubVnetGateways": + err = unpopulate(val, "AllowRemoteVnetToUseHubVnetGateways", &h.AllowRemoteVnetToUseHubVnetGateways) + delete(rawMsg, key) + case "enableInternetSecurity": + err = unpopulate(val, "EnableInternetSecurity", &h.EnableInternetSecurity) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) + case "remoteVirtualNetwork": + err = unpopulate(val, "RemoteVirtualNetwork", &h.RemoteVirtualNetwork) + delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &h.RoutingConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IDPSQueryObject. +func (i IDPSQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filters", i.Filters) + populate(objectMap, "orderBy", i.OrderBy) + populate(objectMap, "resultsPerPage", i.ResultsPerPage) + populate(objectMap, "search", i.Search) + populate(objectMap, "skip", i.Skip) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IDPSQueryObject. +func (i *IDPSQueryObject) 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 "filters": + err = unpopulate(val, "Filters", &i.Filters) + delete(rawMsg, key) + case "orderBy": + err = unpopulate(val, "OrderBy", &i.OrderBy) + delete(rawMsg, key) + case "resultsPerPage": + err = unpopulate(val, "ResultsPerPage", &i.ResultsPerPage) + delete(rawMsg, key) + case "search": + err = unpopulate(val, "Search", &i.Search) + delete(rawMsg, key) + case "skip": + err = unpopulate(val, "Skip", &i.Skip) + 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 IPAddressAvailabilityResult. +func (i IPAddressAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", i.Available) + populate(objectMap, "availableIPAddresses", i.AvailableIPAddresses) + populate(objectMap, "isPlatformReserved", i.IsPlatformReserved) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressAvailabilityResult. +func (i *IPAddressAvailabilityResult) 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 "available": + err = unpopulate(val, "Available", &i.Available) + delete(rawMsg, key) + case "availableIPAddresses": + err = unpopulate(val, "AvailableIPAddresses", &i.AvailableIPAddresses) + delete(rawMsg, key) + case "isPlatformReserved": + err = unpopulate(val, "IsPlatformReserved", &i.IsPlatformReserved) + 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 IPAllocation. +func (i IPAllocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocation. +func (i *IPAllocation) 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 "location": + err = unpopulate(val, "Location", &i.Location) + 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 "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 IPAllocationListResult. +func (i IPAllocationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocationListResult. +func (i *IPAllocationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 IPAllocationPropertiesFormat. +func (i IPAllocationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocationTags", i.AllocationTags) + populate(objectMap, "ipamAllocationId", i.IpamAllocationID) + populate(objectMap, "prefix", i.Prefix) + populate(objectMap, "prefixLength", i.PrefixLength) + populate(objectMap, "prefixType", i.PrefixType) + populate(objectMap, "subnet", i.Subnet) + populate(objectMap, "type", i.Type) + populate(objectMap, "virtualNetwork", i.VirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAllocationPropertiesFormat. +func (i *IPAllocationPropertiesFormat) 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 "allocationTags": + err = unpopulate(val, "AllocationTags", &i.AllocationTags) + delete(rawMsg, key) + case "ipamAllocationId": + err = unpopulate(val, "IpamAllocationID", &i.IpamAllocationID) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &i.Prefix) + delete(rawMsg, key) + case "prefixLength": + err = unpopulate(val, "PrefixLength", &i.PrefixLength) + delete(rawMsg, key) + case "prefixType": + err = unpopulate(val, "PrefixType", &i.PrefixType) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &i.VirtualNetwork) + 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 IPConfiguration. +func (i IPConfiguration) 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfiguration. +func (i *IPConfiguration) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPConfigurationBgpPeeringAddress. +func (i IPConfigurationBgpPeeringAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customBgpIpAddresses", i.CustomBgpIPAddresses) + populate(objectMap, "defaultBgpIpAddresses", i.DefaultBgpIPAddresses) + populate(objectMap, "ipconfigurationId", i.IPConfigurationID) + populate(objectMap, "tunnelIpAddresses", i.TunnelIPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationBgpPeeringAddress. +func (i *IPConfigurationBgpPeeringAddress) 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 "customBgpIpAddresses": + err = unpopulate(val, "CustomBgpIPAddresses", &i.CustomBgpIPAddresses) + delete(rawMsg, key) + case "defaultBgpIpAddresses": + err = unpopulate(val, "DefaultBgpIPAddresses", &i.DefaultBgpIPAddresses) + delete(rawMsg, key) + case "ipconfigurationId": + err = unpopulate(val, "IPConfigurationID", &i.IPConfigurationID) + delete(rawMsg, key) + case "tunnelIpAddresses": + err = unpopulate(val, "TunnelIPAddresses", &i.TunnelIPAddresses) + 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 IPConfigurationProfile. +func (i IPConfigurationProfile) 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 IPConfigurationProfile. +func (i *IPConfigurationProfile) 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 IPConfigurationProfilePropertiesFormat. +func (i IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "subnet", i.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationProfilePropertiesFormat. +func (i *IPConfigurationProfilePropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + 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 IPConfigurationPropertiesFormat. +func (i IPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", i.PrivateIPAddress) + populate(objectMap, "privateIPAllocationMethod", i.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "publicIPAddress", i.PublicIPAddress) + populate(objectMap, "subnet", i.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfigurationPropertiesFormat. +func (i *IPConfigurationPropertiesFormat) 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 "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &i.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &i.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &i.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + 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 IPGroup. +func (i IPGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroup. +func (i *IPGroup) 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 "location": + err = unpopulate(val, "Location", &i.Location) + 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 "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 IPGroupListResult. +func (i IPGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroupListResult. +func (i *IPGroupListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 IPGroupPropertiesFormat. +func (i IPGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "firewallPolicies", i.FirewallPolicies) + populate(objectMap, "firewalls", i.Firewalls) + populate(objectMap, "ipAddresses", i.IPAddresses) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroupPropertiesFormat. +func (i *IPGroupPropertiesFormat) 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 "firewallPolicies": + err = unpopulate(val, "FirewallPolicies", &i.FirewallPolicies) + delete(rawMsg, key) + case "firewalls": + err = unpopulate(val, "Firewalls", &i.Firewalls) + delete(rawMsg, key) + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &i.IPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + 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 IPPrefixesList. +func (i IPPrefixesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipPrefixes", i.IPPrefixes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPPrefixesList. +func (i *IPPrefixesList) 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 "ipPrefixes": + err = unpopulate(val, "IPPrefixes", &i.IPPrefixes) + 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 IPSecPolicy. +func (i IPSecPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dhGroup", i.DhGroup) + populate(objectMap, "ipsecEncryption", i.IPSecEncryption) + populate(objectMap, "ipsecIntegrity", i.IPSecIntegrity) + populate(objectMap, "ikeEncryption", i.IkeEncryption) + populate(objectMap, "ikeIntegrity", i.IkeIntegrity) + populate(objectMap, "pfsGroup", i.PfsGroup) + populate(objectMap, "saDataSizeKilobytes", i.SaDataSizeKilobytes) + populate(objectMap, "saLifeTimeSeconds", i.SaLifeTimeSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPSecPolicy. +func (i *IPSecPolicy) 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 "dhGroup": + err = unpopulate(val, "DhGroup", &i.DhGroup) + delete(rawMsg, key) + case "ipsecEncryption": + err = unpopulate(val, "IPSecEncryption", &i.IPSecEncryption) + delete(rawMsg, key) + case "ipsecIntegrity": + err = unpopulate(val, "IPSecIntegrity", &i.IPSecIntegrity) + delete(rawMsg, key) + case "ikeEncryption": + err = unpopulate(val, "IkeEncryption", &i.IkeEncryption) + delete(rawMsg, key) + case "ikeIntegrity": + err = unpopulate(val, "IkeIntegrity", &i.IkeIntegrity) + delete(rawMsg, key) + case "pfsGroup": + err = unpopulate(val, "PfsGroup", &i.PfsGroup) + delete(rawMsg, key) + case "saDataSizeKilobytes": + err = unpopulate(val, "SaDataSizeKilobytes", &i.SaDataSizeKilobytes) + delete(rawMsg, key) + case "saLifeTimeSeconds": + err = unpopulate(val, "SaLifeTimeSeconds", &i.SaLifeTimeSeconds) + 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 IPTag. +func (i IPTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipTagType", i.IPTagType) + populate(objectMap, "tag", i.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. +func (i *IPTag) 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 "ipTagType": + err = unpopulate(val, "IPTagType", &i.IPTagType) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &i.Tag) + 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 IPv6CircuitConnectionConfig. +func (i IPv6CircuitConnectionConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", i.AddressPrefix) + populate(objectMap, "circuitConnectionStatus", i.CircuitConnectionStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6CircuitConnectionConfig. +func (i *IPv6CircuitConnectionConfig) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &i.AddressPrefix) + delete(rawMsg, key) + case "circuitConnectionStatus": + err = unpopulate(val, "CircuitConnectionStatus", &i.CircuitConnectionStatus) + 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 IPv6ExpressRouteCircuitPeeringConfig. +func (i IPv6ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "microsoftPeeringConfig", i.MicrosoftPeeringConfig) + populate(objectMap, "primaryPeerAddressPrefix", i.PrimaryPeerAddressPrefix) + populate(objectMap, "routeFilter", i.RouteFilter) + populate(objectMap, "secondaryPeerAddressPrefix", i.SecondaryPeerAddressPrefix) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6ExpressRouteCircuitPeeringConfig. +func (i *IPv6ExpressRouteCircuitPeeringConfig) 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 "microsoftPeeringConfig": + err = unpopulate(val, "MicrosoftPeeringConfig", &i.MicrosoftPeeringConfig) + delete(rawMsg, key) + case "primaryPeerAddressPrefix": + err = unpopulate(val, "PrimaryPeerAddressPrefix", &i.PrimaryPeerAddressPrefix) + delete(rawMsg, key) + case "routeFilter": + err = unpopulate(val, "RouteFilter", &i.RouteFilter) + delete(rawMsg, key) + case "secondaryPeerAddressPrefix": + err = unpopulate(val, "SecondaryPeerAddressPrefix", &i.SecondaryPeerAddressPrefix) + 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 InboundNatPool. +func (i InboundNatPool) 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 InboundNatPool. +func (i *InboundNatPool) 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 InboundNatPoolPropertiesFormat. +func (i InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendPort", i.BackendPort) + populate(objectMap, "enableFloatingIP", i.EnableFloatingIP) + populate(objectMap, "enableTcpReset", i.EnableTCPReset) + populate(objectMap, "frontendIPConfiguration", i.FrontendIPConfiguration) + populate(objectMap, "frontendPortRangeEnd", i.FrontendPortRangeEnd) + populate(objectMap, "frontendPortRangeStart", i.FrontendPortRangeStart) + populate(objectMap, "idleTimeoutInMinutes", i.IdleTimeoutInMinutes) + populate(objectMap, "protocol", i.Protocol) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatPoolPropertiesFormat. +func (i *InboundNatPoolPropertiesFormat) 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 "backendPort": + err = unpopulate(val, "BackendPort", &i.BackendPort) + delete(rawMsg, key) + case "enableFloatingIP": + err = unpopulate(val, "EnableFloatingIP", &i.EnableFloatingIP) + delete(rawMsg, key) + case "enableTcpReset": + err = unpopulate(val, "EnableTCPReset", &i.EnableTCPReset) + delete(rawMsg, key) + case "frontendIPConfiguration": + err = unpopulate(val, "FrontendIPConfiguration", &i.FrontendIPConfiguration) + delete(rawMsg, key) + case "frontendPortRangeEnd": + err = unpopulate(val, "FrontendPortRangeEnd", &i.FrontendPortRangeEnd) + delete(rawMsg, key) + case "frontendPortRangeStart": + err = unpopulate(val, "FrontendPortRangeStart", &i.FrontendPortRangeStart) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &i.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &i.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + 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 InboundNatRule. +func (i InboundNatRule) 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 InboundNatRule. +func (i *InboundNatRule) 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 InboundNatRuleListResult. +func (i InboundNatRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRuleListResult. +func (i *InboundNatRuleListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InboundNatRulePortMapping. +func (i InboundNatRulePortMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendPort", i.BackendPort) + populate(objectMap, "frontendPort", i.FrontendPort) + populate(objectMap, "inboundNatRuleName", i.InboundNatRuleName) + populate(objectMap, "protocol", i.Protocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRulePortMapping. +func (i *InboundNatRulePortMapping) 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 "backendPort": + err = unpopulate(val, "BackendPort", &i.BackendPort) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &i.FrontendPort) + delete(rawMsg, key) + case "inboundNatRuleName": + err = unpopulate(val, "InboundNatRuleName", &i.InboundNatRuleName) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &i.Protocol) + 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 InboundNatRulePropertiesFormat. +func (i InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", i.BackendAddressPool) + populate(objectMap, "backendIPConfiguration", i.BackendIPConfiguration) + populate(objectMap, "backendPort", i.BackendPort) + populate(objectMap, "enableFloatingIP", i.EnableFloatingIP) + populate(objectMap, "enableTcpReset", i.EnableTCPReset) + populate(objectMap, "frontendIPConfiguration", i.FrontendIPConfiguration) + populate(objectMap, "frontendPort", i.FrontendPort) + populate(objectMap, "frontendPortRangeEnd", i.FrontendPortRangeEnd) + populate(objectMap, "frontendPortRangeStart", i.FrontendPortRangeStart) + populate(objectMap, "idleTimeoutInMinutes", i.IdleTimeoutInMinutes) + populate(objectMap, "protocol", i.Protocol) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRulePropertiesFormat. +func (i *InboundNatRulePropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &i.BackendAddressPool) + delete(rawMsg, key) + case "backendIPConfiguration": + err = unpopulate(val, "BackendIPConfiguration", &i.BackendIPConfiguration) + delete(rawMsg, key) + case "backendPort": + err = unpopulate(val, "BackendPort", &i.BackendPort) + delete(rawMsg, key) + case "enableFloatingIP": + err = unpopulate(val, "EnableFloatingIP", &i.EnableFloatingIP) + delete(rawMsg, key) + case "enableTcpReset": + err = unpopulate(val, "EnableTCPReset", &i.EnableTCPReset) + delete(rawMsg, key) + case "frontendIPConfiguration": + err = unpopulate(val, "FrontendIPConfiguration", &i.FrontendIPConfiguration) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &i.FrontendPort) + delete(rawMsg, key) + case "frontendPortRangeEnd": + err = unpopulate(val, "FrontendPortRangeEnd", &i.FrontendPortRangeEnd) + delete(rawMsg, key) + case "frontendPortRangeStart": + err = unpopulate(val, "FrontendPortRangeStart", &i.FrontendPortRangeStart) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &i.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &i.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + 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 InboundSecurityRule. +func (i InboundSecurityRule) 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 InboundSecurityRule. +func (i *InboundSecurityRule) 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 InboundSecurityRuleProperties. +func (i InboundSecurityRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "rules", i.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundSecurityRuleProperties. +func (i *InboundSecurityRuleProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &i.Rules) + 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 InboundSecurityRules. +func (i InboundSecurityRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationPortRange", i.DestinationPortRange) + populate(objectMap, "protocol", i.Protocol) + populate(objectMap, "sourceAddressPrefix", i.SourceAddressPrefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundSecurityRules. +func (i *InboundSecurityRules) 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 "destinationPortRange": + err = unpopulate(val, "DestinationPortRange", &i.DestinationPortRange) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &i.Protocol) + delete(rawMsg, key) + case "sourceAddressPrefix": + err = unpopulate(val, "SourceAddressPrefix", &i.SourceAddressPrefix) + 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 IntentPolicy. +func (i IntentPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IntentPolicy. +func (i *IntentPolicy) 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 "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 IntentPolicyConfiguration. +func (i IntentPolicyConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkIntentPolicyName", i.NetworkIntentPolicyName) + populate(objectMap, "sourceNetworkIntentPolicy", i.SourceNetworkIntentPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IntentPolicyConfiguration. +func (i *IntentPolicyConfiguration) 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 "networkIntentPolicyName": + err = unpopulate(val, "NetworkIntentPolicyName", &i.NetworkIntentPolicyName) + delete(rawMsg, key) + case "sourceNetworkIntentPolicy": + err = unpopulate(val, "SourceNetworkIntentPolicy", &i.SourceNetworkIntentPolicy) + 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 Interface. +func (i Interface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "extendedLocation", i.ExtendedLocation) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Interface. +func (i *Interface) 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 "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &i.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + 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 "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 InterfaceAssociation. +func (i InterfaceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "securityRules", i.SecurityRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceAssociation. +func (i *InterfaceAssociation) 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 "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "securityRules": + err = unpopulate(val, "SecurityRules", &i.SecurityRules) + 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 InterfaceDNSSettings. +func (i InterfaceDNSSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appliedDnsServers", i.AppliedDNSServers) + populate(objectMap, "dnsServers", i.DNSServers) + populate(objectMap, "internalDnsNameLabel", i.InternalDNSNameLabel) + populate(objectMap, "internalDomainNameSuffix", i.InternalDomainNameSuffix) + populate(objectMap, "internalFqdn", i.InternalFqdn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceDNSSettings. +func (i *InterfaceDNSSettings) 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 "appliedDnsServers": + err = unpopulate(val, "AppliedDNSServers", &i.AppliedDNSServers) + delete(rawMsg, key) + case "dnsServers": + err = unpopulate(val, "DNSServers", &i.DNSServers) + delete(rawMsg, key) + case "internalDnsNameLabel": + err = unpopulate(val, "InternalDNSNameLabel", &i.InternalDNSNameLabel) + delete(rawMsg, key) + case "internalDomainNameSuffix": + err = unpopulate(val, "InternalDomainNameSuffix", &i.InternalDomainNameSuffix) + delete(rawMsg, key) + case "internalFqdn": + err = unpopulate(val, "InternalFqdn", &i.InternalFqdn) + 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 InterfaceIPConfiguration. +func (i InterfaceIPConfiguration) 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 InterfaceIPConfiguration. +func (i *InterfaceIPConfiguration) 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 InterfaceIPConfigurationListResult. +func (i InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationListResult. +func (i *InterfaceIPConfigurationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InterfaceIPConfigurationPrivateLinkConnectionProperties. +func (i InterfaceIPConfigurationPrivateLinkConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdns", i.Fqdns) + populate(objectMap, "groupId", i.GroupID) + populate(objectMap, "requiredMemberName", i.RequiredMemberName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationPrivateLinkConnectionProperties. +func (i *InterfaceIPConfigurationPrivateLinkConnectionProperties) 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 "fqdns": + err = unpopulate(val, "Fqdns", &i.Fqdns) + delete(rawMsg, key) + case "groupId": + err = unpopulate(val, "GroupID", &i.GroupID) + delete(rawMsg, key) + case "requiredMemberName": + err = unpopulate(val, "RequiredMemberName", &i.RequiredMemberName) + 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 InterfaceIPConfigurationPropertiesFormat. +func (i InterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationGatewayBackendAddressPools", i.ApplicationGatewayBackendAddressPools) + populate(objectMap, "applicationSecurityGroups", i.ApplicationSecurityGroups) + populate(objectMap, "gatewayLoadBalancer", i.GatewayLoadBalancer) + populate(objectMap, "loadBalancerBackendAddressPools", i.LoadBalancerBackendAddressPools) + populate(objectMap, "loadBalancerInboundNatRules", i.LoadBalancerInboundNatRules) + populate(objectMap, "primary", i.Primary) + populate(objectMap, "privateIPAddress", i.PrivateIPAddress) + populate(objectMap, "privateIPAddressVersion", i.PrivateIPAddressVersion) + populate(objectMap, "privateIPAllocationMethod", i.PrivateIPAllocationMethod) + populate(objectMap, "privateLinkConnectionProperties", i.PrivateLinkConnectionProperties) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "publicIPAddress", i.PublicIPAddress) + populate(objectMap, "subnet", i.Subnet) + populate(objectMap, "virtualNetworkTaps", i.VirtualNetworkTaps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceIPConfigurationPropertiesFormat. +func (i *InterfaceIPConfigurationPropertiesFormat) 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 "applicationGatewayBackendAddressPools": + err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &i.ApplicationGatewayBackendAddressPools) + delete(rawMsg, key) + case "applicationSecurityGroups": + err = unpopulate(val, "ApplicationSecurityGroups", &i.ApplicationSecurityGroups) + delete(rawMsg, key) + case "gatewayLoadBalancer": + err = unpopulate(val, "GatewayLoadBalancer", &i.GatewayLoadBalancer) + delete(rawMsg, key) + case "loadBalancerBackendAddressPools": + err = unpopulate(val, "LoadBalancerBackendAddressPools", &i.LoadBalancerBackendAddressPools) + delete(rawMsg, key) + case "loadBalancerInboundNatRules": + err = unpopulate(val, "LoadBalancerInboundNatRules", &i.LoadBalancerInboundNatRules) + delete(rawMsg, key) + case "primary": + err = unpopulate(val, "Primary", &i.Primary) + delete(rawMsg, key) + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &i.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAddressVersion": + err = unpopulate(val, "PrivateIPAddressVersion", &i.PrivateIPAddressVersion) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &i.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "privateLinkConnectionProperties": + err = unpopulate(val, "PrivateLinkConnectionProperties", &i.PrivateLinkConnectionProperties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &i.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + delete(rawMsg, key) + case "virtualNetworkTaps": + err = unpopulate(val, "VirtualNetworkTaps", &i.VirtualNetworkTaps) + 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 InterfaceListResult. +func (i InterfaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceListResult. +func (i *InterfaceListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InterfaceLoadBalancerListResult. +func (i InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceLoadBalancerListResult. +func (i *InterfaceLoadBalancerListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InterfacePropertiesFormat. +func (i InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auxiliaryMode", i.AuxiliaryMode) + populate(objectMap, "dnsSettings", i.DNSSettings) + populate(objectMap, "disableTcpStateTracking", i.DisableTCPStateTracking) + populate(objectMap, "dscpConfiguration", i.DscpConfiguration) + populate(objectMap, "enableAcceleratedNetworking", i.EnableAcceleratedNetworking) + populate(objectMap, "enableIPForwarding", i.EnableIPForwarding) + populate(objectMap, "hostedWorkloads", i.HostedWorkloads) + populate(objectMap, "ipConfigurations", i.IPConfigurations) + populate(objectMap, "macAddress", i.MacAddress) + populate(objectMap, "migrationPhase", i.MigrationPhase) + populate(objectMap, "networkSecurityGroup", i.NetworkSecurityGroup) + populate(objectMap, "nicType", i.NicType) + populate(objectMap, "primary", i.Primary) + populate(objectMap, "privateEndpoint", i.PrivateEndpoint) + populate(objectMap, "privateLinkService", i.PrivateLinkService) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "resourceGuid", i.ResourceGUID) + populate(objectMap, "tapConfigurations", i.TapConfigurations) + populate(objectMap, "virtualMachine", i.VirtualMachine) + populate(objectMap, "vnetEncryptionSupported", i.VnetEncryptionSupported) + populate(objectMap, "workloadType", i.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfacePropertiesFormat. +func (i *InterfacePropertiesFormat) 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 "auxiliaryMode": + err = unpopulate(val, "AuxiliaryMode", &i.AuxiliaryMode) + delete(rawMsg, key) + case "dnsSettings": + err = unpopulate(val, "DNSSettings", &i.DNSSettings) + delete(rawMsg, key) + case "disableTcpStateTracking": + err = unpopulate(val, "DisableTCPStateTracking", &i.DisableTCPStateTracking) + delete(rawMsg, key) + case "dscpConfiguration": + err = unpopulate(val, "DscpConfiguration", &i.DscpConfiguration) + delete(rawMsg, key) + case "enableAcceleratedNetworking": + err = unpopulate(val, "EnableAcceleratedNetworking", &i.EnableAcceleratedNetworking) + delete(rawMsg, key) + case "enableIPForwarding": + err = unpopulate(val, "EnableIPForwarding", &i.EnableIPForwarding) + delete(rawMsg, key) + case "hostedWorkloads": + err = unpopulate(val, "HostedWorkloads", &i.HostedWorkloads) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &i.IPConfigurations) + delete(rawMsg, key) + case "macAddress": + err = unpopulate(val, "MacAddress", &i.MacAddress) + delete(rawMsg, key) + case "migrationPhase": + err = unpopulate(val, "MigrationPhase", &i.MigrationPhase) + delete(rawMsg, key) + case "networkSecurityGroup": + err = unpopulate(val, "NetworkSecurityGroup", &i.NetworkSecurityGroup) + delete(rawMsg, key) + case "nicType": + err = unpopulate(val, "NicType", &i.NicType) + delete(rawMsg, key) + case "primary": + err = unpopulate(val, "Primary", &i.Primary) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &i.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkService": + err = unpopulate(val, "PrivateLinkService", &i.PrivateLinkService) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &i.ResourceGUID) + delete(rawMsg, key) + case "tapConfigurations": + err = unpopulate(val, "TapConfigurations", &i.TapConfigurations) + delete(rawMsg, key) + case "virtualMachine": + err = unpopulate(val, "VirtualMachine", &i.VirtualMachine) + delete(rawMsg, key) + case "vnetEncryptionSupported": + err = unpopulate(val, "VnetEncryptionSupported", &i.VnetEncryptionSupported) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &i.WorkloadType) + 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 InterfaceTapConfiguration. +func (i InterfaceTapConfiguration) 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 InterfaceTapConfiguration. +func (i *InterfaceTapConfiguration) 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 InterfaceTapConfigurationListResult. +func (i InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceTapConfigurationListResult. +func (i *InterfaceTapConfigurationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InterfaceTapConfigurationPropertiesFormat. +func (i InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "virtualNetworkTap", i.VirtualNetworkTap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceTapConfigurationPropertiesFormat. +func (i *InterfaceTapConfigurationPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "virtualNetworkTap": + err = unpopulate(val, "VirtualNetworkTap", &i.VirtualNetworkTap) + 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 ListHubRouteTablesResult. +func (l ListHubRouteTablesResult) 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 ListHubRouteTablesResult. +func (l *ListHubRouteTablesResult) 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 ListHubVirtualNetworkConnectionsResult. +func (l ListHubVirtualNetworkConnectionsResult) 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 ListHubVirtualNetworkConnectionsResult. +func (l *ListHubVirtualNetworkConnectionsResult) 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 ListP2SVPNGatewaysResult. +func (l ListP2SVPNGatewaysResult) 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 ListP2SVPNGatewaysResult. +func (l *ListP2SVPNGatewaysResult) 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 ListRouteMapsResult. +func (l ListRouteMapsResult) 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 ListRouteMapsResult. +func (l *ListRouteMapsResult) 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 ListRoutingIntentResult. +func (l ListRoutingIntentResult) 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 ListRoutingIntentResult. +func (l *ListRoutingIntentResult) 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 ListVPNConnectionsResult. +func (l ListVPNConnectionsResult) 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 ListVPNConnectionsResult. +func (l *ListVPNConnectionsResult) 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 ListVPNGatewayNatRulesResult. +func (l ListVPNGatewayNatRulesResult) 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 ListVPNGatewayNatRulesResult. +func (l *ListVPNGatewayNatRulesResult) 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 ListVPNGatewaysResult. +func (l ListVPNGatewaysResult) 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 ListVPNGatewaysResult. +func (l *ListVPNGatewaysResult) 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 ListVPNServerConfigurationPolicyGroupsResult. +func (l ListVPNServerConfigurationPolicyGroupsResult) 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 ListVPNServerConfigurationPolicyGroupsResult. +func (l *ListVPNServerConfigurationPolicyGroupsResult) 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 ListVPNServerConfigurationsResult. +func (l ListVPNServerConfigurationsResult) 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 ListVPNServerConfigurationsResult. +func (l *ListVPNServerConfigurationsResult) 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 ListVPNSiteLinkConnectionsResult. +func (l ListVPNSiteLinkConnectionsResult) 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 ListVPNSiteLinkConnectionsResult. +func (l *ListVPNSiteLinkConnectionsResult) 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 ListVPNSiteLinksResult. +func (l ListVPNSiteLinksResult) 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 ListVPNSiteLinksResult. +func (l *ListVPNSiteLinksResult) 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 ListVPNSitesResult. +func (l ListVPNSitesResult) 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 ListVPNSitesResult. +func (l *ListVPNSitesResult) 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 ListVirtualHubBgpConnectionResults. +func (l ListVirtualHubBgpConnectionResults) 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 ListVirtualHubBgpConnectionResults. +func (l *ListVirtualHubBgpConnectionResults) 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 ListVirtualHubIPConfigurationResults. +func (l ListVirtualHubIPConfigurationResults) 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 ListVirtualHubIPConfigurationResults. +func (l *ListVirtualHubIPConfigurationResults) 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 ListVirtualHubRouteTableV2SResult. +func (l ListVirtualHubRouteTableV2SResult) 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 ListVirtualHubRouteTableV2SResult. +func (l *ListVirtualHubRouteTableV2SResult) 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 ListVirtualHubsResult. +func (l ListVirtualHubsResult) 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 ListVirtualHubsResult. +func (l *ListVirtualHubsResult) 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 ListVirtualNetworkGatewayNatRulesResult. +func (l ListVirtualNetworkGatewayNatRulesResult) 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 ListVirtualNetworkGatewayNatRulesResult. +func (l *ListVirtualNetworkGatewayNatRulesResult) 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 ListVirtualWANsResult. +func (l ListVirtualWANsResult) 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 ListVirtualWANsResult. +func (l *ListVirtualWANsResult) 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 LoadBalancer. +func (l LoadBalancer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", l.Etag) + populate(objectMap, "extendedLocation", l.ExtendedLocation) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "sku", l.SKU) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancer. +func (l *LoadBalancer) 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 "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &l.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + 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 "sku": + err = unpopulate(val, "SKU", &l.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + 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 LoadBalancerBackendAddress. +func (l LoadBalancerBackendAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerBackendAddress. +func (l *LoadBalancerBackendAddress) 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 "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + 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 LoadBalancerBackendAddressPoolListResult. +func (l LoadBalancerBackendAddressPoolListResult) 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 LoadBalancerBackendAddressPoolListResult. +func (l *LoadBalancerBackendAddressPoolListResult) 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 LoadBalancerBackendAddressPropertiesFormat. +func (l LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminState", l.AdminState) + populate(objectMap, "ipAddress", l.IPAddress) + populate(objectMap, "inboundNatRulesPortMapping", l.InboundNatRulesPortMapping) + populate(objectMap, "loadBalancerFrontendIPConfiguration", l.LoadBalancerFrontendIPConfiguration) + populate(objectMap, "networkInterfaceIPConfiguration", l.NetworkInterfaceIPConfiguration) + populate(objectMap, "subnet", l.Subnet) + populate(objectMap, "virtualNetwork", l.VirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerBackendAddressPropertiesFormat. +func (l *LoadBalancerBackendAddressPropertiesFormat) 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 "adminState": + err = unpopulate(val, "AdminState", &l.AdminState) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &l.IPAddress) + delete(rawMsg, key) + case "inboundNatRulesPortMapping": + err = unpopulate(val, "InboundNatRulesPortMapping", &l.InboundNatRulesPortMapping) + delete(rawMsg, key) + case "loadBalancerFrontendIPConfiguration": + err = unpopulate(val, "LoadBalancerFrontendIPConfiguration", &l.LoadBalancerFrontendIPConfiguration) + delete(rawMsg, key) + case "networkInterfaceIPConfiguration": + err = unpopulate(val, "NetworkInterfaceIPConfiguration", &l.NetworkInterfaceIPConfiguration) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &l.Subnet) + delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &l.VirtualNetwork) + 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 LoadBalancerFrontendIPConfigurationListResult. +func (l LoadBalancerFrontendIPConfigurationListResult) 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 LoadBalancerFrontendIPConfigurationListResult. +func (l *LoadBalancerFrontendIPConfigurationListResult) 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 LoadBalancerListResult. +func (l LoadBalancerListResult) 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 LoadBalancerListResult. +func (l *LoadBalancerListResult) 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 LoadBalancerLoadBalancingRuleListResult. +func (l LoadBalancerLoadBalancingRuleListResult) 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 LoadBalancerLoadBalancingRuleListResult. +func (l *LoadBalancerLoadBalancingRuleListResult) 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 LoadBalancerOutboundRuleListResult. +func (l LoadBalancerOutboundRuleListResult) 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 LoadBalancerOutboundRuleListResult. +func (l *LoadBalancerOutboundRuleListResult) 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 LoadBalancerProbeListResult. +func (l LoadBalancerProbeListResult) 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 LoadBalancerProbeListResult. +func (l *LoadBalancerProbeListResult) 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 LoadBalancerPropertiesFormat. +func (l LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPools", l.BackendAddressPools) + populate(objectMap, "frontendIPConfigurations", l.FrontendIPConfigurations) + populate(objectMap, "inboundNatPools", l.InboundNatPools) + populate(objectMap, "inboundNatRules", l.InboundNatRules) + populate(objectMap, "loadBalancingRules", l.LoadBalancingRules) + populate(objectMap, "outboundRules", l.OutboundRules) + populate(objectMap, "probes", l.Probes) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "resourceGuid", l.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerPropertiesFormat. +func (l *LoadBalancerPropertiesFormat) 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 "backendAddressPools": + err = unpopulate(val, "BackendAddressPools", &l.BackendAddressPools) + delete(rawMsg, key) + case "frontendIPConfigurations": + err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) + delete(rawMsg, key) + case "inboundNatPools": + err = unpopulate(val, "InboundNatPools", &l.InboundNatPools) + delete(rawMsg, key) + case "inboundNatRules": + err = unpopulate(val, "InboundNatRules", &l.InboundNatRules) + delete(rawMsg, key) + case "loadBalancingRules": + err = unpopulate(val, "LoadBalancingRules", &l.LoadBalancingRules) + delete(rawMsg, key) + case "outboundRules": + err = unpopulate(val, "OutboundRules", &l.OutboundRules) + delete(rawMsg, key) + case "probes": + err = unpopulate(val, "Probes", &l.Probes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &l.ResourceGUID) + 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 LoadBalancerSKU. +func (l LoadBalancerSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", l.Name) + populate(objectMap, "tier", l.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerSKU. +func (l *LoadBalancerSKU) 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 "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &l.Tier) + 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 LoadBalancerVipSwapRequest. +func (l LoadBalancerVipSwapRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "frontendIPConfigurations", l.FrontendIPConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequest. +func (l *LoadBalancerVipSwapRequest) 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 "frontendIPConfigurations": + err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) + 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 LoadBalancerVipSwapRequestFrontendIPConfiguration. +func (l LoadBalancerVipSwapRequestFrontendIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfiguration. +func (l *LoadBalancerVipSwapRequestFrontendIPConfiguration) 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 "properties": + err = unpopulate(val, "Properties", &l.Properties) + 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 LoadBalancerVipSwapRequestFrontendIPConfigurationProperties. +func (l LoadBalancerVipSwapRequestFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "publicIPAddress", l.PublicIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties. +func (l *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties) 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 "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &l.PublicIPAddress) + 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 LoadBalancingRule. +func (l LoadBalancingRule) 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 LoadBalancingRule. +func (l *LoadBalancingRule) 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 LoadBalancingRulePropertiesFormat. +func (l LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendAddressPool", l.BackendAddressPool) + populate(objectMap, "backendAddressPools", l.BackendAddressPools) + populate(objectMap, "backendPort", l.BackendPort) + populate(objectMap, "disableOutboundSnat", l.DisableOutboundSnat) + populate(objectMap, "enableFloatingIP", l.EnableFloatingIP) + populate(objectMap, "enableTcpReset", l.EnableTCPReset) + populate(objectMap, "frontendIPConfiguration", l.FrontendIPConfiguration) + populate(objectMap, "frontendPort", l.FrontendPort) + populate(objectMap, "idleTimeoutInMinutes", l.IdleTimeoutInMinutes) + populate(objectMap, "loadDistribution", l.LoadDistribution) + populate(objectMap, "probe", l.Probe) + populate(objectMap, "protocol", l.Protocol) + populate(objectMap, "provisioningState", l.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancingRulePropertiesFormat. +func (l *LoadBalancingRulePropertiesFormat) 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 "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &l.BackendAddressPool) + delete(rawMsg, key) + case "backendAddressPools": + err = unpopulate(val, "BackendAddressPools", &l.BackendAddressPools) + delete(rawMsg, key) + case "backendPort": + err = unpopulate(val, "BackendPort", &l.BackendPort) + delete(rawMsg, key) + case "disableOutboundSnat": + err = unpopulate(val, "DisableOutboundSnat", &l.DisableOutboundSnat) + delete(rawMsg, key) + case "enableFloatingIP": + err = unpopulate(val, "EnableFloatingIP", &l.EnableFloatingIP) + delete(rawMsg, key) + case "enableTcpReset": + err = unpopulate(val, "EnableTCPReset", &l.EnableTCPReset) + delete(rawMsg, key) + case "frontendIPConfiguration": + err = unpopulate(val, "FrontendIPConfiguration", &l.FrontendIPConfiguration) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &l.FrontendPort) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &l.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "loadDistribution": + err = unpopulate(val, "LoadDistribution", &l.LoadDistribution) + delete(rawMsg, key) + case "probe": + err = unpopulate(val, "Probe", &l.Probe) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &l.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + 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 LocalNetworkGateway. +func (l LocalNetworkGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", l.Etag) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkGateway. +func (l *LocalNetworkGateway) 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 "location": + err = unpopulate(val, "Location", &l.Location) + 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 "tags": + err = unpopulate(val, "Tags", &l.Tags) + 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 LocalNetworkGatewayListResult. +func (l LocalNetworkGatewayListResult) 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 LocalNetworkGatewayListResult. +func (l *LocalNetworkGatewayListResult) 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 LocalNetworkGatewayPropertiesFormat. +func (l LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpSettings", l.BgpSettings) + populate(objectMap, "fqdn", l.Fqdn) + populate(objectMap, "gatewayIpAddress", l.GatewayIPAddress) + populate(objectMap, "localNetworkAddressSpace", l.LocalNetworkAddressSpace) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "resourceGuid", l.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalNetworkGatewayPropertiesFormat. +func (l *LocalNetworkGatewayPropertiesFormat) 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 "bgpSettings": + err = unpopulate(val, "BgpSettings", &l.BgpSettings) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &l.Fqdn) + delete(rawMsg, key) + case "gatewayIpAddress": + err = unpopulate(val, "GatewayIPAddress", &l.GatewayIPAddress) + delete(rawMsg, key) + case "localNetworkAddressSpace": + err = unpopulate(val, "LocalNetworkAddressSpace", &l.LocalNetworkAddressSpace) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &l.ResourceGUID) + 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 LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) 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 "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + 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 ManagedRuleGroupOverride. +func (m ManagedRuleGroupOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroupName", m.RuleGroupName) + populate(objectMap, "rules", m.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleGroupOverride. +func (m *ManagedRuleGroupOverride) 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 "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &m.RuleGroupName) + delete(rawMsg, 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 ManagedRuleOverride. +func (m ManagedRuleOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", m.Action) + populate(objectMap, "ruleId", m.RuleID) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleOverride. +func (m *ManagedRuleOverride) 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 "action": + err = unpopulate(val, "Action", &m.Action) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &m.RuleID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + 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 ManagedRuleSet. +func (m ManagedRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroupOverrides", m.RuleGroupOverrides) + populate(objectMap, "ruleSetType", m.RuleSetType) + populate(objectMap, "ruleSetVersion", m.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSet. +func (m *ManagedRuleSet) 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 "ruleGroupOverrides": + err = unpopulate(val, "RuleGroupOverrides", &m.RuleGroupOverrides) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &m.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &m.RuleSetVersion) + 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 ManagedRulesDefinition. +func (m ManagedRulesDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclusions", m.Exclusions) + populate(objectMap, "managedRuleSets", m.ManagedRuleSets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRulesDefinition. +func (m *ManagedRulesDefinition) 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 "exclusions": + err = unpopulate(val, "Exclusions", &m.Exclusions) + delete(rawMsg, key) + case "managedRuleSets": + err = unpopulate(val, "ManagedRuleSets", &m.ManagedRuleSets) + 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 ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) 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 "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + 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 Manager. +func (m Manager) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Manager. +func (m *Manager) 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 "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + 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 ManagerCommit. +func (m ManagerCommit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "commitId", m.CommitID) + populate(objectMap, "commitType", m.CommitType) + populate(objectMap, "configurationIds", m.ConfigurationIDs) + populate(objectMap, "targetLocations", m.TargetLocations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerCommit. +func (m *ManagerCommit) 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 "commitId": + err = unpopulate(val, "CommitID", &m.CommitID) + delete(rawMsg, key) + case "commitType": + err = unpopulate(val, "CommitType", &m.CommitType) + delete(rawMsg, key) + case "configurationIds": + err = unpopulate(val, "ConfigurationIDs", &m.ConfigurationIDs) + delete(rawMsg, key) + case "targetLocations": + err = unpopulate(val, "TargetLocations", &m.TargetLocations) + 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 ManagerConnection. +func (m ManagerConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnection. +func (m *ManagerConnection) 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 "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, 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 "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + 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 ManagerConnectionListResult. +func (m ManagerConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnectionListResult. +func (m *ManagerConnectionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 ManagerConnectionProperties. +func (m ManagerConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionState", m.ConnectionState) + populate(objectMap, "description", m.Description) + populate(objectMap, "networkManagerId", m.NetworkManagerID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerConnectionProperties. +func (m *ManagerConnectionProperties) 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 "connectionState": + err = unpopulate(val, "ConnectionState", &m.ConnectionState) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "networkManagerId": + err = unpopulate(val, "NetworkManagerID", &m.NetworkManagerID) + 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 ManagerDeploymentStatus. +func (m ManagerDeploymentStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "commitTime", m.CommitTime) + populate(objectMap, "configurationIds", m.ConfigurationIDs) + populate(objectMap, "deploymentStatus", m.DeploymentStatus) + populate(objectMap, "deploymentType", m.DeploymentType) + populate(objectMap, "errorMessage", m.ErrorMessage) + populate(objectMap, "region", m.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatus. +func (m *ManagerDeploymentStatus) 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 "commitTime": + err = unpopulateTimeRFC3339(val, "CommitTime", &m.CommitTime) + delete(rawMsg, key) + case "configurationIds": + err = unpopulate(val, "ConfigurationIDs", &m.ConfigurationIDs) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &m.DeploymentStatus) + delete(rawMsg, key) + case "deploymentType": + err = unpopulate(val, "DeploymentType", &m.DeploymentType) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &m.Region) + 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 ManagerDeploymentStatusListResult. +func (m ManagerDeploymentStatusListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", m.SkipToken) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatusListResult. +func (m *ManagerDeploymentStatusListResult) 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 "skipToken": + err = unpopulate(val, "SkipToken", &m.SkipToken) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 ManagerDeploymentStatusParameter. +func (m ManagerDeploymentStatusParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deploymentTypes", m.DeploymentTypes) + populate(objectMap, "regions", m.Regions) + populate(objectMap, "skipToken", m.SkipToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerDeploymentStatusParameter. +func (m *ManagerDeploymentStatusParameter) 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 "deploymentTypes": + err = unpopulate(val, "DeploymentTypes", &m.DeploymentTypes) + delete(rawMsg, key) + case "regions": + err = unpopulate(val, "Regions", &m.Regions) + delete(rawMsg, key) + case "skipToken": + err = unpopulate(val, "SkipToken", &m.SkipToken) + 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 ManagerEffectiveConnectivityConfigurationListResult. +func (m ManagerEffectiveConnectivityConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", m.SkipToken) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerEffectiveConnectivityConfigurationListResult. +func (m *ManagerEffectiveConnectivityConfigurationListResult) 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 "skipToken": + err = unpopulate(val, "SkipToken", &m.SkipToken) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 ManagerEffectiveSecurityAdminRulesListResult. +func (m ManagerEffectiveSecurityAdminRulesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", m.SkipToken) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerEffectiveSecurityAdminRulesListResult. +func (m *ManagerEffectiveSecurityAdminRulesListResult) 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 "skipToken": + err = unpopulate(val, "SkipToken", &m.SkipToken) + delete(rawMsg, key) + case "value": + m.Value, err = unmarshalEffectiveBaseSecurityAdminRuleClassificationArray(val) + 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 ManagerListResult. +func (m ManagerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerListResult. +func (m *ManagerListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 ManagerProperties. +func (m ManagerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", m.Description) + populate(objectMap, "networkManagerScopeAccesses", m.NetworkManagerScopeAccesses) + populate(objectMap, "networkManagerScopes", m.NetworkManagerScopes) + populate(objectMap, "provisioningState", m.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerProperties. +func (m *ManagerProperties) 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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "networkManagerScopeAccesses": + err = unpopulate(val, "NetworkManagerScopeAccesses", &m.NetworkManagerScopeAccesses) + delete(rawMsg, key) + case "networkManagerScopes": + err = unpopulate(val, "NetworkManagerScopes", &m.NetworkManagerScopes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + 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 ManagerPropertiesNetworkManagerScopes. +func (m ManagerPropertiesNetworkManagerScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "crossTenantScopes", m.CrossTenantScopes) + populate(objectMap, "managementGroups", m.ManagementGroups) + populate(objectMap, "subscriptions", m.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerPropertiesNetworkManagerScopes. +func (m *ManagerPropertiesNetworkManagerScopes) 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 "crossTenantScopes": + err = unpopulate(val, "CrossTenantScopes", &m.CrossTenantScopes) + delete(rawMsg, key) + case "managementGroups": + err = unpopulate(val, "ManagementGroups", &m.ManagementGroups) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &m.Subscriptions) + 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 ManagerSecurityGroupItem. +func (m ManagerSecurityGroupItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkGroupId", m.NetworkGroupID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagerSecurityGroupItem. +func (m *ManagerSecurityGroupItem) 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 "networkGroupId": + err = unpopulate(val, "NetworkGroupID", &m.NetworkGroupID) + 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 MatchCondition. +func (m MatchCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchValues", m.MatchValues) + populate(objectMap, "matchVariables", m.MatchVariables) + populate(objectMap, "negationConditon", m.NegationConditon) + populate(objectMap, "operator", m.Operator) + populate(objectMap, "transforms", m.Transforms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MatchCondition. +func (m *MatchCondition) 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 "matchValues": + err = unpopulate(val, "MatchValues", &m.MatchValues) + delete(rawMsg, key) + case "matchVariables": + err = unpopulate(val, "MatchVariables", &m.MatchVariables) + delete(rawMsg, key) + case "negationConditon": + err = unpopulate(val, "NegationConditon", &m.NegationConditon) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &m.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &m.Transforms) + 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 MatchVariable. +func (m MatchVariable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selector", m.Selector) + populate(objectMap, "variableName", m.VariableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MatchVariable. +func (m *MatchVariable) 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 "selector": + err = unpopulate(val, "Selector", &m.Selector) + delete(rawMsg, key) + case "variableName": + err = unpopulate(val, "VariableName", &m.VariableName) + 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 MatchedRule. +func (m MatchedRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", m.Action) + populate(objectMap, "ruleName", m.RuleName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MatchedRule. +func (m *MatchedRule) 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 "action": + err = unpopulate(val, "Action", &m.Action) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &m.RuleName) + 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, "availabilities", m.Availabilities) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) + populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) + populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) + 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 "availabilities": + err = unpopulate(val, "Availabilities", &m.Availabilities) + 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 "enableRegionalMdmAccount": + err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "isInternal": + err = unpopulate(val, "IsInternal", &m.IsInternal) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + 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 "sourceMdmAccount": + err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) + delete(rawMsg, key) + case "sourceMdmNamespace": + err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) + 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 NatGateway. +func (n NatGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "sku", n.SKU) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + populate(objectMap, "zones", n.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatGateway. +func (n *NatGateway) 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 "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + 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 "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &n.Zones) + 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 NatGatewayListResult. +func (n NatGatewayListResult) 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 NatGatewayListResult. +func (n *NatGatewayListResult) 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 NatGatewayPropertiesFormat. +func (n NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "idleTimeoutInMinutes", n.IdleTimeoutInMinutes) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publicIpAddresses", n.PublicIPAddresses) + populate(objectMap, "publicIpPrefixes", n.PublicIPPrefixes) + populate(objectMap, "resourceGuid", n.ResourceGUID) + populate(objectMap, "subnets", n.Subnets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewayPropertiesFormat. +func (n *NatGatewayPropertiesFormat) 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 "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &n.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publicIpAddresses": + err = unpopulate(val, "PublicIPAddresses", &n.PublicIPAddresses) + delete(rawMsg, key) + case "publicIpPrefixes": + err = unpopulate(val, "PublicIPPrefixes", &n.PublicIPPrefixes) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &n.ResourceGUID) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &n.Subnets) + 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 NatGatewaySKU. +func (n NatGatewaySKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewaySKU. +func (n *NatGatewaySKU) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NatRule. +func (n NatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "destinationAddresses", n.DestinationAddresses) + populate(objectMap, "destinationPorts", n.DestinationPorts) + populate(objectMap, "ipProtocols", n.IPProtocols) + populate(objectMap, "name", n.Name) + objectMap["ruleType"] = FirewallPolicyRuleTypeNatRule + populate(objectMap, "sourceAddresses", n.SourceAddresses) + populate(objectMap, "sourceIpGroups", n.SourceIPGroups) + populate(objectMap, "translatedAddress", n.TranslatedAddress) + populate(objectMap, "translatedFqdn", n.TranslatedFqdn) + populate(objectMap, "translatedPort", n.TranslatedPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatRule. +func (n *NatRule) 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 "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &n.DestinationAddresses) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &n.DestinationPorts) + delete(rawMsg, key) + case "ipProtocols": + err = unpopulate(val, "IPProtocols", &n.IPProtocols) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &n.RuleType) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &n.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &n.SourceIPGroups) + delete(rawMsg, key) + case "translatedAddress": + err = unpopulate(val, "TranslatedAddress", &n.TranslatedAddress) + delete(rawMsg, key) + case "translatedFqdn": + err = unpopulate(val, "TranslatedFqdn", &n.TranslatedFqdn) + delete(rawMsg, key) + case "translatedPort": + err = unpopulate(val, "TranslatedPort", &n.TranslatedPort) + 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 NatRulePortMapping. +func (n NatRulePortMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendPort", n.BackendPort) + populate(objectMap, "frontendPort", n.FrontendPort) + populate(objectMap, "inboundNatRuleName", n.InboundNatRuleName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatRulePortMapping. +func (n *NatRulePortMapping) 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 "backendPort": + err = unpopulate(val, "BackendPort", &n.BackendPort) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &n.FrontendPort) + delete(rawMsg, key) + case "inboundNatRuleName": + err = unpopulate(val, "InboundNatRuleName", &n.InboundNatRuleName) + 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 NextHopParameters. +func (n NextHopParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationIPAddress", n.DestinationIPAddress) + populate(objectMap, "sourceIPAddress", n.SourceIPAddress) + populate(objectMap, "targetNicResourceId", n.TargetNicResourceID) + populate(objectMap, "targetResourceId", n.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopParameters. +func (n *NextHopParameters) 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 "destinationIPAddress": + err = unpopulate(val, "DestinationIPAddress", &n.DestinationIPAddress) + delete(rawMsg, key) + case "sourceIPAddress": + err = unpopulate(val, "SourceIPAddress", &n.SourceIPAddress) + delete(rawMsg, key) + case "targetNicResourceId": + err = unpopulate(val, "TargetNicResourceID", &n.TargetNicResourceID) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &n.TargetResourceID) + 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 NextHopResult. +func (n NextHopResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextHopIpAddress", n.NextHopIPAddress) + populate(objectMap, "nextHopType", n.NextHopType) + populate(objectMap, "routeTableId", n.RouteTableID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopResult. +func (n *NextHopResult) 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 "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &n.NextHopIPAddress) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &n.NextHopType) + delete(rawMsg, key) + case "routeTableId": + err = unpopulate(val, "RouteTableID", &n.RouteTableID) + 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 O365BreakOutCategoryPolicies. +func (o O365BreakOutCategoryPolicies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allow", o.Allow) + populate(objectMap, "default", o.Default) + populate(objectMap, "optimize", o.Optimize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type O365BreakOutCategoryPolicies. +func (o *O365BreakOutCategoryPolicies) 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 "allow": + err = unpopulate(val, "Allow", &o.Allow) + delete(rawMsg, key) + case "default": + err = unpopulate(val, "Default", &o.Default) + delete(rawMsg, key) + case "optimize": + err = unpopulate(val, "Optimize", &o.Optimize) + 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 O365PolicyProperties. +func (o O365PolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "breakOutCategories", o.BreakOutCategories) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type O365PolicyProperties. +func (o *O365PolicyProperties) 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 "breakOutCategories": + err = unpopulate(val, "BreakOutCategories", &o.BreakOutCategories) + 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 Office365PolicyProperties. +func (o Office365PolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "breakOutCategories", o.BreakOutCategories) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Office365PolicyProperties. +func (o *Office365PolicyProperties) 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 "breakOutCategories": + err = unpopulate(val, "BreakOutCategories", &o.BreakOutCategories) + 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, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + 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 "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + 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, "nextLink", o.NextLink) + 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 "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, 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 OperationPropertiesFormat. +func (o OperationPropertiesFormat) 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 OperationPropertiesFormat. +func (o *OperationPropertiesFormat) 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 OperationPropertiesFormatServiceSpecification. +func (o OperationPropertiesFormatServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSpecifications", o.LogSpecifications) + populate(objectMap, "metricSpecifications", o.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesFormatServiceSpecification. +func (o *OperationPropertiesFormatServiceSpecification) 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 "logSpecifications": + err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) + 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 OrderBy. +func (o OrderBy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "field", o.Field) + populate(objectMap, "order", o.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OrderBy. +func (o *OrderBy) 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 "field": + err = unpopulate(val, "Field", &o.Field) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &o.Order) + 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 OutboundRule. +func (o OutboundRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", o.Etag) + 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 OutboundRule. +func (o *OutboundRule) 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 "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, 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 OutboundRulePropertiesFormat. +func (o OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocatedOutboundPorts", o.AllocatedOutboundPorts) + populate(objectMap, "backendAddressPool", o.BackendAddressPool) + populate(objectMap, "enableTcpReset", o.EnableTCPReset) + populate(objectMap, "frontendIPConfigurations", o.FrontendIPConfigurations) + populate(objectMap, "idleTimeoutInMinutes", o.IdleTimeoutInMinutes) + populate(objectMap, "protocol", o.Protocol) + populate(objectMap, "provisioningState", o.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRulePropertiesFormat. +func (o *OutboundRulePropertiesFormat) 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 "allocatedOutboundPorts": + err = unpopulate(val, "AllocatedOutboundPorts", &o.AllocatedOutboundPorts) + delete(rawMsg, key) + case "backendAddressPool": + err = unpopulate(val, "BackendAddressPool", &o.BackendAddressPool) + delete(rawMsg, key) + case "enableTcpReset": + err = unpopulate(val, "EnableTCPReset", &o.EnableTCPReset) + delete(rawMsg, key) + case "frontendIPConfigurations": + err = unpopulate(val, "FrontendIPConfigurations", &o.FrontendIPConfigurations) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &o.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &o.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + 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 OwaspCrsExclusionEntry. +func (o OwaspCrsExclusionEntry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclusionManagedRuleSets", o.ExclusionManagedRuleSets) + populate(objectMap, "matchVariable", o.MatchVariable) + populate(objectMap, "selector", o.Selector) + populate(objectMap, "selectorMatchOperator", o.SelectorMatchOperator) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OwaspCrsExclusionEntry. +func (o *OwaspCrsExclusionEntry) 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 "exclusionManagedRuleSets": + err = unpopulate(val, "ExclusionManagedRuleSets", &o.ExclusionManagedRuleSets) + delete(rawMsg, key) + case "matchVariable": + err = unpopulate(val, "MatchVariable", &o.MatchVariable) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &o.Selector) + delete(rawMsg, key) + case "selectorMatchOperator": + err = unpopulate(val, "SelectorMatchOperator", &o.SelectorMatchOperator) + 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 P2SConnectionConfiguration. +func (p P2SConnectionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SConnectionConfiguration. +func (p *P2SConnectionConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type P2SConnectionConfigurationProperties. +func (p P2SConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationPolicyGroupAssociations", p.ConfigurationPolicyGroupAssociations) + populate(objectMap, "enableInternetSecurity", p.EnableInternetSecurity) + populate(objectMap, "previousConfigurationPolicyGroupAssociations", p.PreviousConfigurationPolicyGroupAssociations) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "routingConfiguration", p.RoutingConfiguration) + populate(objectMap, "vpnClientAddressPool", p.VPNClientAddressPool) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SConnectionConfigurationProperties. +func (p *P2SConnectionConfigurationProperties) 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 "configurationPolicyGroupAssociations": + err = unpopulate(val, "ConfigurationPolicyGroupAssociations", &p.ConfigurationPolicyGroupAssociations) + delete(rawMsg, key) + case "enableInternetSecurity": + err = unpopulate(val, "EnableInternetSecurity", &p.EnableInternetSecurity) + delete(rawMsg, key) + case "previousConfigurationPolicyGroupAssociations": + err = unpopulate(val, "PreviousConfigurationPolicyGroupAssociations", &p.PreviousConfigurationPolicyGroupAssociations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &p.RoutingConfiguration) + delete(rawMsg, key) + case "vpnClientAddressPool": + err = unpopulate(val, "VPNClientAddressPool", &p.VPNClientAddressPool) + 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 P2SVPNConnectionHealth. +func (p P2SVPNConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUrl", p.SasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionHealth. +func (p *P2SVPNConnectionHealth) 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 "sasUrl": + err = unpopulate(val, "SasURL", &p.SasURL) + 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 P2SVPNConnectionHealthRequest. +func (p P2SVPNConnectionHealthRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "outputBlobSasUrl", p.OutputBlobSasURL) + populate(objectMap, "vpnUserNamesFilter", p.VPNUserNamesFilter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionHealthRequest. +func (p *P2SVPNConnectionHealthRequest) 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 "outputBlobSasUrl": + err = unpopulate(val, "OutputBlobSasURL", &p.OutputBlobSasURL) + delete(rawMsg, key) + case "vpnUserNamesFilter": + err = unpopulate(val, "VPNUserNamesFilter", &p.VPNUserNamesFilter) + 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 P2SVPNConnectionRequest. +func (p P2SVPNConnectionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "vpnConnectionIds", p.VPNConnectionIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNConnectionRequest. +func (p *P2SVPNConnectionRequest) 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 "vpnConnectionIds": + err = unpopulate(val, "VPNConnectionIDs", &p.VPNConnectionIDs) + 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 P2SVPNGateway. +func (p P2SVPNGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNGateway. +func (p *P2SVPNGateway) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 P2SVPNGatewayProperties. +func (p P2SVPNGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customDnsServers", p.CustomDNSServers) + populate(objectMap, "isRoutingPreferenceInternet", p.IsRoutingPreferenceInternet) + populate(objectMap, "p2SConnectionConfigurations", p.P2SConnectionConfigurations) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "vpnClientConnectionHealth", p.VPNClientConnectionHealth) + populate(objectMap, "vpnGatewayScaleUnit", p.VPNGatewayScaleUnit) + populate(objectMap, "vpnServerConfiguration", p.VPNServerConfiguration) + populate(objectMap, "virtualHub", p.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNGatewayProperties. +func (p *P2SVPNGatewayProperties) 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 "customDnsServers": + err = unpopulate(val, "CustomDNSServers", &p.CustomDNSServers) + delete(rawMsg, key) + case "isRoutingPreferenceInternet": + err = unpopulate(val, "IsRoutingPreferenceInternet", &p.IsRoutingPreferenceInternet) + delete(rawMsg, key) + case "p2SConnectionConfigurations": + err = unpopulate(val, "P2SConnectionConfigurations", &p.P2SConnectionConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "vpnClientConnectionHealth": + err = unpopulate(val, "VPNClientConnectionHealth", &p.VPNClientConnectionHealth) + delete(rawMsg, key) + case "vpnGatewayScaleUnit": + err = unpopulate(val, "VPNGatewayScaleUnit", &p.VPNGatewayScaleUnit) + delete(rawMsg, key) + case "vpnServerConfiguration": + err = unpopulate(val, "VPNServerConfiguration", &p.VPNServerConfiguration) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &p.VirtualHub) + 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 P2SVPNProfileParameters. +func (p P2SVPNProfileParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationMethod", p.AuthenticationMethod) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type P2SVPNProfileParameters. +func (p *P2SVPNProfileParameters) 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 "authenticationMethod": + err = unpopulate(val, "AuthenticationMethod", &p.AuthenticationMethod) + 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 PacketCapture. +func (p PacketCapture) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCapture. +func (p *PacketCapture) 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 "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 PacketCaptureFilter. +func (p PacketCaptureFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localIPAddress", p.LocalIPAddress) + populate(objectMap, "localPort", p.LocalPort) + populate(objectMap, "protocol", p.Protocol) + populate(objectMap, "remoteIPAddress", p.RemoteIPAddress) + populate(objectMap, "remotePort", p.RemotePort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureFilter. +func (p *PacketCaptureFilter) 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 "localIPAddress": + err = unpopulate(val, "LocalIPAddress", &p.LocalIPAddress) + delete(rawMsg, key) + case "localPort": + err = unpopulate(val, "LocalPort", &p.LocalPort) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &p.Protocol) + delete(rawMsg, key) + case "remoteIPAddress": + err = unpopulate(val, "RemoteIPAddress", &p.RemoteIPAddress) + delete(rawMsg, key) + case "remotePort": + err = unpopulate(val, "RemotePort", &p.RemotePort) + 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 PacketCaptureListResult. +func (p PacketCaptureListResult) 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 PacketCaptureListResult. +func (p *PacketCaptureListResult) 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 PacketCaptureMachineScope. +func (p PacketCaptureMachineScope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclude", p.Exclude) + populate(objectMap, "include", p.Include) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureMachineScope. +func (p *PacketCaptureMachineScope) 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 "exclude": + err = unpopulate(val, "Exclude", &p.Exclude) + delete(rawMsg, key) + case "include": + err = unpopulate(val, "Include", &p.Include) + 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 PacketCaptureParameters. +func (p PacketCaptureParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bytesToCapturePerPacket", p.BytesToCapturePerPacket) + populate(objectMap, "filters", p.Filters) + populate(objectMap, "scope", p.Scope) + populate(objectMap, "storageLocation", p.StorageLocation) + populate(objectMap, "target", p.Target) + populate(objectMap, "targetType", p.TargetType) + populate(objectMap, "timeLimitInSeconds", p.TimeLimitInSeconds) + populate(objectMap, "totalBytesPerSession", p.TotalBytesPerSession) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureParameters. +func (p *PacketCaptureParameters) 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 "bytesToCapturePerPacket": + err = unpopulate(val, "BytesToCapturePerPacket", &p.BytesToCapturePerPacket) + delete(rawMsg, key) + case "filters": + err = unpopulate(val, "Filters", &p.Filters) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + delete(rawMsg, key) + case "storageLocation": + err = unpopulate(val, "StorageLocation", &p.StorageLocation) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) + delete(rawMsg, key) + case "targetType": + err = unpopulate(val, "TargetType", &p.TargetType) + delete(rawMsg, key) + case "timeLimitInSeconds": + err = unpopulate(val, "TimeLimitInSeconds", &p.TimeLimitInSeconds) + delete(rawMsg, key) + case "totalBytesPerSession": + err = unpopulate(val, "TotalBytesPerSession", &p.TotalBytesPerSession) + 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 PacketCaptureQueryStatusResult. +func (p PacketCaptureQueryStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "captureStartTime", p.CaptureStartTime) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "packetCaptureError", p.PacketCaptureError) + populate(objectMap, "packetCaptureStatus", p.PacketCaptureStatus) + populate(objectMap, "stopReason", p.StopReason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureQueryStatusResult. +func (p *PacketCaptureQueryStatusResult) 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 "captureStartTime": + err = unpopulateTimeRFC3339(val, "CaptureStartTime", &p.CaptureStartTime) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "packetCaptureError": + err = unpopulate(val, "PacketCaptureError", &p.PacketCaptureError) + delete(rawMsg, key) + case "packetCaptureStatus": + err = unpopulate(val, "PacketCaptureStatus", &p.PacketCaptureStatus) + delete(rawMsg, key) + case "stopReason": + err = unpopulate(val, "StopReason", &p.StopReason) + 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 PacketCaptureResult. +func (p PacketCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureResult. +func (p *PacketCaptureResult) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PacketCaptureResultProperties. +func (p PacketCaptureResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bytesToCapturePerPacket", p.BytesToCapturePerPacket) + populate(objectMap, "filters", p.Filters) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "scope", p.Scope) + populate(objectMap, "storageLocation", p.StorageLocation) + populate(objectMap, "target", p.Target) + populate(objectMap, "targetType", p.TargetType) + populate(objectMap, "timeLimitInSeconds", p.TimeLimitInSeconds) + populate(objectMap, "totalBytesPerSession", p.TotalBytesPerSession) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureResultProperties. +func (p *PacketCaptureResultProperties) 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 "bytesToCapturePerPacket": + err = unpopulate(val, "BytesToCapturePerPacket", &p.BytesToCapturePerPacket) + delete(rawMsg, key) + case "filters": + err = unpopulate(val, "Filters", &p.Filters) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + delete(rawMsg, key) + case "storageLocation": + err = unpopulate(val, "StorageLocation", &p.StorageLocation) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) + delete(rawMsg, key) + case "targetType": + err = unpopulate(val, "TargetType", &p.TargetType) + delete(rawMsg, key) + case "timeLimitInSeconds": + err = unpopulate(val, "TimeLimitInSeconds", &p.TimeLimitInSeconds) + delete(rawMsg, key) + case "totalBytesPerSession": + err = unpopulate(val, "TotalBytesPerSession", &p.TotalBytesPerSession) + 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 PacketCaptureStorageLocation. +func (p PacketCaptureStorageLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filePath", p.FilePath) + populate(objectMap, "storageId", p.StorageID) + populate(objectMap, "storagePath", p.StoragePath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PacketCaptureStorageLocation. +func (p *PacketCaptureStorageLocation) 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 "filePath": + err = unpopulate(val, "FilePath", &p.FilePath) + delete(rawMsg, key) + case "storageId": + err = unpopulate(val, "StorageID", &p.StorageID) + delete(rawMsg, key) + case "storagePath": + err = unpopulate(val, "StoragePath", &p.StoragePath) + 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 Parameter. +func (p Parameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asPath", p.AsPath) + populate(objectMap, "community", p.Community) + populate(objectMap, "routePrefix", p.RoutePrefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Parameter. +func (p *Parameter) 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 "asPath": + err = unpopulate(val, "AsPath", &p.AsPath) + delete(rawMsg, key) + case "community": + err = unpopulate(val, "Community", &p.Community) + delete(rawMsg, key) + case "routePrefix": + err = unpopulate(val, "RoutePrefix", &p.RoutePrefix) + 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 PartnerManagedResourceProperties. +func (p PartnerManagedResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "internalLoadBalancerId", p.InternalLoadBalancerID) + populate(objectMap, "standardLoadBalancerId", p.StandardLoadBalancerID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerManagedResourceProperties. +func (p *PartnerManagedResourceProperties) 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 "internalLoadBalancerId": + err = unpopulate(val, "InternalLoadBalancerID", &p.InternalLoadBalancerID) + delete(rawMsg, key) + case "standardLoadBalancerId": + err = unpopulate(val, "StandardLoadBalancerID", &p.StandardLoadBalancerID) + 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 PatchObject. +func (p PatchObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchObject. +func (p *PatchObject) 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PatchRouteFilter. +func (p PatchRouteFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilter. +func (p *PatchRouteFilter) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PatchRouteFilterRule. +func (p PatchRouteFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchRouteFilterRule. +func (p *PatchRouteFilterRule) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeerExpressRouteCircuitConnection. +func (p PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 PeerExpressRouteCircuitConnection. +func (p *PeerExpressRouteCircuitConnection) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 PeerExpressRouteCircuitConnectionListResult. +func (p PeerExpressRouteCircuitConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerExpressRouteCircuitConnectionListResult. +func (p *PeerExpressRouteCircuitConnectionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PeerExpressRouteCircuitConnectionPropertiesFormat. +func (p PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", p.AddressPrefix) + populate(objectMap, "authResourceGuid", p.AuthResourceGUID) + populate(objectMap, "circuitConnectionStatus", p.CircuitConnectionStatus) + populate(objectMap, "connectionName", p.ConnectionName) + populate(objectMap, "expressRouteCircuitPeering", p.ExpressRouteCircuitPeering) + populate(objectMap, "peerExpressRouteCircuitPeering", p.PeerExpressRouteCircuitPeering) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerExpressRouteCircuitConnectionPropertiesFormat. +func (p *PeerExpressRouteCircuitConnectionPropertiesFormat) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &p.AddressPrefix) + delete(rawMsg, key) + case "authResourceGuid": + err = unpopulate(val, "AuthResourceGUID", &p.AuthResourceGUID) + delete(rawMsg, key) + case "circuitConnectionStatus": + err = unpopulate(val, "CircuitConnectionStatus", &p.CircuitConnectionStatus) + delete(rawMsg, key) + case "connectionName": + err = unpopulate(val, "ConnectionName", &p.ConnectionName) + delete(rawMsg, key) + case "expressRouteCircuitPeering": + err = unpopulate(val, "ExpressRouteCircuitPeering", &p.ExpressRouteCircuitPeering) + delete(rawMsg, key) + case "peerExpressRouteCircuitPeering": + err = unpopulate(val, "PeerExpressRouteCircuitPeering", &p.PeerExpressRouteCircuitPeering) + 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 PeerRoute. +func (p PeerRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asPath", p.AsPath) + populate(objectMap, "localAddress", p.LocalAddress) + populate(objectMap, "network", p.Network) + populate(objectMap, "nextHop", p.NextHop) + populate(objectMap, "origin", p.Origin) + populate(objectMap, "sourcePeer", p.SourcePeer) + populate(objectMap, "weight", p.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeerRoute. +func (p *PeerRoute) 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 "asPath": + err = unpopulate(val, "AsPath", &p.AsPath) + delete(rawMsg, key) + case "localAddress": + err = unpopulate(val, "LocalAddress", &p.LocalAddress) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &p.Network) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &p.NextHop) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &p.Origin) + delete(rawMsg, key) + case "sourcePeer": + err = unpopulate(val, "SourcePeer", &p.SourcePeer) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &p.Weight) + 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 PeerRouteList. +func (p PeerRouteList) 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 PeerRouteList. +func (p *PeerRouteList) 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 PolicySettings. +func (p PolicySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customBlockResponseBody", p.CustomBlockResponseBody) + populate(objectMap, "customBlockResponseStatusCode", p.CustomBlockResponseStatusCode) + populate(objectMap, "fileUploadLimitInMb", p.FileUploadLimitInMb) + populate(objectMap, "maxRequestBodySizeInKb", p.MaxRequestBodySizeInKb) + populate(objectMap, "mode", p.Mode) + populate(objectMap, "requestBodyCheck", p.RequestBodyCheck) + populate(objectMap, "state", p.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySettings. +func (p *PolicySettings) 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 "customBlockResponseBody": + err = unpopulate(val, "CustomBlockResponseBody", &p.CustomBlockResponseBody) + delete(rawMsg, key) + case "customBlockResponseStatusCode": + err = unpopulate(val, "CustomBlockResponseStatusCode", &p.CustomBlockResponseStatusCode) + delete(rawMsg, key) + case "fileUploadLimitInMb": + err = unpopulate(val, "FileUploadLimitInMb", &p.FileUploadLimitInMb) + delete(rawMsg, key) + case "maxRequestBodySizeInKb": + err = unpopulate(val, "MaxRequestBodySizeInKb", &p.MaxRequestBodySizeInKb) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &p.Mode) + delete(rawMsg, key) + case "requestBodyCheck": + err = unpopulate(val, "RequestBodyCheck", &p.RequestBodyCheck) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + 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 PrepareNetworkPoliciesRequest. +func (p PrepareNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkIntentPolicyConfigurations", p.NetworkIntentPolicyConfigurations) + populate(objectMap, "serviceName", p.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareNetworkPoliciesRequest. +func (p *PrepareNetworkPoliciesRequest) 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 "networkIntentPolicyConfigurations": + err = unpopulate(val, "NetworkIntentPolicyConfigurations", &p.NetworkIntentPolicyConfigurations) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &p.ServiceName) + 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 PrivateDNSZoneConfig. +func (p PrivateDNSZoneConfig) 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 PrivateDNSZoneConfig. +func (p *PrivateDNSZoneConfig) 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 PrivateDNSZoneGroup. +func (p PrivateDNSZoneGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroup. +func (p *PrivateDNSZoneGroup) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateDNSZoneGroupListResult. +func (p PrivateDNSZoneGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroupListResult. +func (p *PrivateDNSZoneGroupListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PrivateDNSZoneGroupPropertiesFormat. +func (p PrivateDNSZoneGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateDnsZoneConfigs", p.PrivateDNSZoneConfigs) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZoneGroupPropertiesFormat. +func (p *PrivateDNSZoneGroupPropertiesFormat) 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 "privateDnsZoneConfigs": + err = unpopulate(val, "PrivateDNSZoneConfigs", &p.PrivateDNSZoneConfigs) + 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 PrivateDNSZonePropertiesFormat. +func (p PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateDnsZoneId", p.PrivateDNSZoneID) + populate(objectMap, "recordSets", p.RecordSets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateDNSZonePropertiesFormat. +func (p *PrivateDNSZonePropertiesFormat) 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 "privateDnsZoneId": + err = unpopulate(val, "PrivateDNSZoneID", &p.PrivateDNSZoneID) + delete(rawMsg, key) + case "recordSets": + err = unpopulate(val, "RecordSets", &p.RecordSets) + 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, "etag", p.Etag) + populate(objectMap, "extendedLocation", p.ExtendedLocation) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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, "nextLink", p.NextLink) + 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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, "linkIdentifier", p.LinkIdentifier) + 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 "linkIdentifier": + err = unpopulate(val, "LinkIdentifier", &p.LinkIdentifier) + delete(rawMsg, 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 PrivateEndpointIPConfiguration. +func (p PrivateEndpointIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 PrivateEndpointIPConfiguration. +func (p *PrivateEndpointIPConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + 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 PrivateEndpointIPConfigurationProperties. +func (p PrivateEndpointIPConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "memberName", p.MemberName) + populate(objectMap, "privateIPAddress", p.PrivateIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointIPConfigurationProperties. +func (p *PrivateEndpointIPConfigurationProperties) 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 "memberName": + err = unpopulate(val, "MemberName", &p.MemberName) + delete(rawMsg, key) + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &p.PrivateIPAddress) + 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 PrivateEndpointListResult. +func (p PrivateEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointListResult. +func (p *PrivateEndpointListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PrivateEndpointProperties. +func (p PrivateEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationSecurityGroups", p.ApplicationSecurityGroups) + populate(objectMap, "customDnsConfigs", p.CustomDNSConfigs) + populate(objectMap, "customNetworkInterfaceName", p.CustomNetworkInterfaceName) + populate(objectMap, "ipConfigurations", p.IPConfigurations) + populate(objectMap, "manualPrivateLinkServiceConnections", p.ManualPrivateLinkServiceConnections) + populate(objectMap, "networkInterfaces", p.NetworkInterfaces) + populate(objectMap, "privateLinkServiceConnections", p.PrivateLinkServiceConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "subnet", p.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperties. +func (p *PrivateEndpointProperties) 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 "applicationSecurityGroups": + err = unpopulate(val, "ApplicationSecurityGroups", &p.ApplicationSecurityGroups) + delete(rawMsg, key) + case "customDnsConfigs": + err = unpopulate(val, "CustomDNSConfigs", &p.CustomDNSConfigs) + delete(rawMsg, key) + case "customNetworkInterfaceName": + err = unpopulate(val, "CustomNetworkInterfaceName", &p.CustomNetworkInterfaceName) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) + delete(rawMsg, key) + case "manualPrivateLinkServiceConnections": + err = unpopulate(val, "ManualPrivateLinkServiceConnections", &p.ManualPrivateLinkServiceConnections) + delete(rawMsg, key) + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) + delete(rawMsg, key) + case "privateLinkServiceConnections": + err = unpopulate(val, "PrivateLinkServiceConnections", &p.PrivateLinkServiceConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &p.Subnet) + 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 PrivateLinkService. +func (p PrivateLinkService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "extendedLocation", p.ExtendedLocation) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkService. +func (p *PrivateLinkService) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PrivateLinkServiceConnection. +func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 PrivateLinkServiceConnection. +func (p *PrivateLinkServiceConnection) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 PrivateLinkServiceConnectionProperties. +func (p PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "requestMessage", p.RequestMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionProperties. +func (p *PrivateLinkServiceConnectionProperties) 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 "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "privateLinkServiceId": + err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &p.RequestMessage) + 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, "actionsRequired", p.ActionsRequired) + 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + 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 PrivateLinkServiceIPConfiguration. +func (p PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 PrivateLinkServiceIPConfiguration. +func (p *PrivateLinkServiceIPConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 PrivateLinkServiceIPConfigurationProperties. +func (p PrivateLinkServiceIPConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primary", p.Primary) + populate(objectMap, "privateIPAddress", p.PrivateIPAddress) + populate(objectMap, "privateIPAddressVersion", p.PrivateIPAddressVersion) + populate(objectMap, "privateIPAllocationMethod", p.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "subnet", p.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceIPConfigurationProperties. +func (p *PrivateLinkServiceIPConfigurationProperties) 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 "primary": + err = unpopulate(val, "Primary", &p.Primary) + delete(rawMsg, key) + case "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &p.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAddressVersion": + err = unpopulate(val, "PrivateIPAddressVersion", &p.PrivateIPAddressVersion) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &p.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &p.Subnet) + 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 PrivateLinkServiceListResult. +func (p PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceListResult. +func (p *PrivateLinkServiceListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PrivateLinkServiceProperties. +func (p PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alias", p.Alias) + populate(objectMap, "autoApproval", p.AutoApproval) + populate(objectMap, "enableProxyProtocol", p.EnableProxyProtocol) + populate(objectMap, "fqdns", p.Fqdns) + populate(objectMap, "ipConfigurations", p.IPConfigurations) + populate(objectMap, "loadBalancerFrontendIpConfigurations", p.LoadBalancerFrontendIPConfigurations) + populate(objectMap, "networkInterfaces", p.NetworkInterfaces) + populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "visibility", p.Visibility) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceProperties. +func (p *PrivateLinkServiceProperties) 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 "alias": + err = unpopulate(val, "Alias", &p.Alias) + delete(rawMsg, key) + case "autoApproval": + err = unpopulate(val, "AutoApproval", &p.AutoApproval) + delete(rawMsg, key) + case "enableProxyProtocol": + err = unpopulate(val, "EnableProxyProtocol", &p.EnableProxyProtocol) + delete(rawMsg, key) + case "fqdns": + err = unpopulate(val, "Fqdns", &p.Fqdns) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) + delete(rawMsg, key) + case "loadBalancerFrontendIpConfigurations": + err = unpopulate(val, "LoadBalancerFrontendIPConfigurations", &p.LoadBalancerFrontendIPConfigurations) + delete(rawMsg, key) + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "visibility": + err = unpopulate(val, "Visibility", &p.Visibility) + 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 PrivateLinkServicePropertiesAutoApproval. +func (p PrivateLinkServicePropertiesAutoApproval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", p.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesAutoApproval. +func (p *PrivateLinkServicePropertiesAutoApproval) 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 "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + 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 PrivateLinkServicePropertiesVisibility. +func (p PrivateLinkServicePropertiesVisibility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", p.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesVisibility. +func (p *PrivateLinkServicePropertiesVisibility) 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 "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + 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 PrivateLinkServiceVisibility. +func (p PrivateLinkServiceVisibility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "visible", p.Visible) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceVisibility. +func (p *PrivateLinkServiceVisibility) 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 "visible": + err = unpopulate(val, "Visible", &p.Visible) + 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 Probe. +func (p Probe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + 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 Probe. +func (p *Probe) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, 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 ProbePropertiesFormat. +func (p ProbePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "intervalInSeconds", p.IntervalInSeconds) + populate(objectMap, "loadBalancingRules", p.LoadBalancingRules) + populate(objectMap, "numberOfProbes", p.NumberOfProbes) + populate(objectMap, "port", p.Port) + populate(objectMap, "probeThreshold", p.ProbeThreshold) + populate(objectMap, "protocol", p.Protocol) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "requestPath", p.RequestPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProbePropertiesFormat. +func (p *ProbePropertiesFormat) 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 "intervalInSeconds": + err = unpopulate(val, "IntervalInSeconds", &p.IntervalInSeconds) + delete(rawMsg, key) + case "loadBalancingRules": + err = unpopulate(val, "LoadBalancingRules", &p.LoadBalancingRules) + delete(rawMsg, key) + case "numberOfProbes": + err = unpopulate(val, "NumberOfProbes", &p.NumberOfProbes) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &p.Port) + delete(rawMsg, key) + case "probeThreshold": + err = unpopulate(val, "ProbeThreshold", &p.ProbeThreshold) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &p.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "requestPath": + err = unpopulate(val, "RequestPath", &p.RequestPath) + 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 Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Profile. +func (p *Profile) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProfileListResult. +func (p ProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult. +func (p *ProfileListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 ProfilePropertiesFormat. +func (p ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerNetworkInterfaceConfigurations", p.ContainerNetworkInterfaceConfigurations) + populate(objectMap, "containerNetworkInterfaces", p.ContainerNetworkInterfaces) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "resourceGuid", p.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesFormat. +func (p *ProfilePropertiesFormat) 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 "containerNetworkInterfaceConfigurations": + err = unpopulate(val, "ContainerNetworkInterfaceConfigurations", &p.ContainerNetworkInterfaceConfigurations) + delete(rawMsg, key) + case "containerNetworkInterfaces": + err = unpopulate(val, "ContainerNetworkInterfaces", &p.ContainerNetworkInterfaces) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) + 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 PropagatedRouteTable. +func (p PropagatedRouteTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ids", p.IDs) + populate(objectMap, "labels", p.Labels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropagatedRouteTable. +func (p *PropagatedRouteTable) 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 "ids": + err = unpopulate(val, "IDs", &p.IDs) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &p.Labels) + 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 ProtocolConfiguration. +func (p ProtocolConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "HTTPConfiguration", p.HTTPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolConfiguration. +func (p *ProtocolConfiguration) 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 "HTTPConfiguration": + err = unpopulate(val, "HTTPConfiguration", &p.HTTPConfiguration) + 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 PublicIPAddress. +func (p PublicIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "extendedLocation", p.ExtendedLocation) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + populate(objectMap, "zones", p.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddress. +func (p *PublicIPAddress) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &p.Zones) + 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 PublicIPAddressDNSSettings. +func (p PublicIPAddressDNSSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainNameLabel", p.DomainNameLabel) + populate(objectMap, "fqdn", p.Fqdn) + populate(objectMap, "reverseFqdn", p.ReverseFqdn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressDNSSettings. +func (p *PublicIPAddressDNSSettings) 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 "domainNameLabel": + err = unpopulate(val, "DomainNameLabel", &p.DomainNameLabel) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &p.Fqdn) + delete(rawMsg, key) + case "reverseFqdn": + err = unpopulate(val, "ReverseFqdn", &p.ReverseFqdn) + 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 PublicIPAddressListResult. +func (p PublicIPAddressListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressListResult. +func (p *PublicIPAddressListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PublicIPAddressPropertiesFormat. +func (p PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsSettings", p.DNSSettings) + populate(objectMap, "ddosSettings", p.DdosSettings) + populate(objectMap, "deleteOption", p.DeleteOption) + populate(objectMap, "ipAddress", p.IPAddress) + populate(objectMap, "ipConfiguration", p.IPConfiguration) + populate(objectMap, "ipTags", p.IPTags) + populate(objectMap, "idleTimeoutInMinutes", p.IdleTimeoutInMinutes) + populate(objectMap, "linkedPublicIPAddress", p.LinkedPublicIPAddress) + populate(objectMap, "migrationPhase", p.MigrationPhase) + populate(objectMap, "natGateway", p.NatGateway) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicIPAddressVersion", p.PublicIPAddressVersion) + populate(objectMap, "publicIPAllocationMethod", p.PublicIPAllocationMethod) + populate(objectMap, "publicIPPrefix", p.PublicIPPrefix) + populate(objectMap, "resourceGuid", p.ResourceGUID) + populate(objectMap, "servicePublicIPAddress", p.ServicePublicIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressPropertiesFormat. +func (p *PublicIPAddressPropertiesFormat) 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 "dnsSettings": + err = unpopulate(val, "DNSSettings", &p.DNSSettings) + delete(rawMsg, key) + case "ddosSettings": + err = unpopulate(val, "DdosSettings", &p.DdosSettings) + delete(rawMsg, key) + case "deleteOption": + err = unpopulate(val, "DeleteOption", &p.DeleteOption) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &p.IPAddress) + delete(rawMsg, key) + case "ipConfiguration": + err = unpopulate(val, "IPConfiguration", &p.IPConfiguration) + delete(rawMsg, key) + case "ipTags": + err = unpopulate(val, "IPTags", &p.IPTags) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &p.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "linkedPublicIPAddress": + err = unpopulate(val, "LinkedPublicIPAddress", &p.LinkedPublicIPAddress) + delete(rawMsg, key) + case "migrationPhase": + err = unpopulate(val, "MigrationPhase", &p.MigrationPhase) + delete(rawMsg, key) + case "natGateway": + err = unpopulate(val, "NatGateway", &p.NatGateway) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddressVersion": + err = unpopulate(val, "PublicIPAddressVersion", &p.PublicIPAddressVersion) + delete(rawMsg, key) + case "publicIPAllocationMethod": + err = unpopulate(val, "PublicIPAllocationMethod", &p.PublicIPAllocationMethod) + delete(rawMsg, key) + case "publicIPPrefix": + err = unpopulate(val, "PublicIPPrefix", &p.PublicIPPrefix) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) + delete(rawMsg, key) + case "servicePublicIPAddress": + err = unpopulate(val, "ServicePublicIPAddress", &p.ServicePublicIPAddress) + 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 PublicIPAddressSKU. +func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "tier", p.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU. +func (p *PublicIPAddressSKU) 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 "tier": + err = unpopulate(val, "Tier", &p.Tier) + 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 PublicIPDdosProtectionStatusResult. +func (p PublicIPDdosProtectionStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ddosProtectionPlanId", p.DdosProtectionPlanID) + populate(objectMap, "isWorkloadProtected", p.IsWorkloadProtected) + populate(objectMap, "publicIpAddress", p.PublicIPAddress) + populate(objectMap, "publicIpAddressId", p.PublicIPAddressID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPDdosProtectionStatusResult. +func (p *PublicIPDdosProtectionStatusResult) 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 "ddosProtectionPlanId": + err = unpopulate(val, "DdosProtectionPlanID", &p.DdosProtectionPlanID) + delete(rawMsg, key) + case "isWorkloadProtected": + err = unpopulate(val, "IsWorkloadProtected", &p.IsWorkloadProtected) + delete(rawMsg, key) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &p.PublicIPAddress) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &p.PublicIPAddressID) + 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 PublicIPPrefix. +func (p PublicIPPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "extendedLocation", p.ExtendedLocation) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + populate(objectMap, "zones", p.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefix. +func (p *PublicIPPrefix) 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 "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &p.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &p.Zones) + 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 PublicIPPrefixListResult. +func (p PublicIPPrefixListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixListResult. +func (p *PublicIPPrefixListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 PublicIPPrefixPropertiesFormat. +func (p PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customIPPrefix", p.CustomIPPrefix) + populate(objectMap, "ipPrefix", p.IPPrefix) + populate(objectMap, "ipTags", p.IPTags) + populate(objectMap, "loadBalancerFrontendIpConfiguration", p.LoadBalancerFrontendIPConfiguration) + populate(objectMap, "natGateway", p.NatGateway) + populate(objectMap, "prefixLength", p.PrefixLength) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicIPAddressVersion", p.PublicIPAddressVersion) + populate(objectMap, "publicIPAddresses", p.PublicIPAddresses) + populate(objectMap, "resourceGuid", p.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixPropertiesFormat. +func (p *PublicIPPrefixPropertiesFormat) 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 "customIPPrefix": + err = unpopulate(val, "CustomIPPrefix", &p.CustomIPPrefix) + delete(rawMsg, key) + case "ipPrefix": + err = unpopulate(val, "IPPrefix", &p.IPPrefix) + delete(rawMsg, key) + case "ipTags": + err = unpopulate(val, "IPTags", &p.IPTags) + delete(rawMsg, key) + case "loadBalancerFrontendIpConfiguration": + err = unpopulate(val, "LoadBalancerFrontendIPConfiguration", &p.LoadBalancerFrontendIPConfiguration) + delete(rawMsg, key) + case "natGateway": + err = unpopulate(val, "NatGateway", &p.NatGateway) + delete(rawMsg, key) + case "prefixLength": + err = unpopulate(val, "PrefixLength", &p.PrefixLength) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddressVersion": + err = unpopulate(val, "PublicIPAddressVersion", &p.PublicIPAddressVersion) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &p.PublicIPAddresses) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) + 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 PublicIPPrefixSKU. +func (p PublicIPPrefixSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "tier", p.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPPrefixSKU. +func (p *PublicIPPrefixSKU) 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 "tier": + err = unpopulate(val, "Tier", &p.Tier) + 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 QosDefinition. +func (q QosDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationIpRanges", q.DestinationIPRanges) + populate(objectMap, "destinationPortRanges", q.DestinationPortRanges) + populate(objectMap, "markings", q.Markings) + populate(objectMap, "protocol", q.Protocol) + populate(objectMap, "sourceIpRanges", q.SourceIPRanges) + populate(objectMap, "sourcePortRanges", q.SourcePortRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QosDefinition. +func (q *QosDefinition) 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 "destinationIpRanges": + err = unpopulate(val, "DestinationIPRanges", &q.DestinationIPRanges) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &q.DestinationPortRanges) + delete(rawMsg, key) + case "markings": + err = unpopulate(val, "Markings", &q.Markings) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &q.Protocol) + delete(rawMsg, key) + case "sourceIpRanges": + err = unpopulate(val, "SourceIPRanges", &q.SourceIPRanges) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &q.SourcePortRanges) + 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 QosIPRange. +func (q QosIPRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endIP", q.EndIP) + populate(objectMap, "startIP", q.StartIP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QosIPRange. +func (q *QosIPRange) 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 "endIP": + err = unpopulate(val, "EndIP", &q.EndIP) + delete(rawMsg, key) + case "startIP": + err = unpopulate(val, "StartIP", &q.StartIP) + 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 QosPortRange. +func (q QosPortRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "end", q.End) + populate(objectMap, "start", q.Start) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QosPortRange. +func (q *QosPortRange) 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 "end": + err = unpopulate(val, "End", &q.End) + delete(rawMsg, key) + case "start": + err = unpopulate(val, "Start", &q.Start) + 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 QueryInboundNatRulePortMappingRequest. +func (q QueryInboundNatRulePortMappingRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddress", q.IPAddress) + populate(objectMap, "ipConfiguration", q.IPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryInboundNatRulePortMappingRequest. +func (q *QueryInboundNatRulePortMappingRequest) 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 "ipAddress": + err = unpopulate(val, "IPAddress", &q.IPAddress) + delete(rawMsg, key) + case "ipConfiguration": + err = unpopulate(val, "IPConfiguration", &q.IPConfiguration) + 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 QueryRequestOptions. +func (q QueryRequestOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skipToken", q.SkipToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryRequestOptions. +func (q *QueryRequestOptions) 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 "skipToken": + err = unpopulate(val, "SkipToken", &q.SkipToken) + 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 QueryResults. +func (q QueryResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchingRecordsCount", q.MatchingRecordsCount) + populate(objectMap, "signatures", q.Signatures) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryResults. +func (q *QueryResults) 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 "matchingRecordsCount": + err = unpopulate(val, "MatchingRecordsCount", &q.MatchingRecordsCount) + delete(rawMsg, key) + case "signatures": + err = unpopulate(val, "Signatures", &q.Signatures) + 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 QueryTroubleshootingParameters. +func (q QueryTroubleshootingParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetResourceId", q.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryTroubleshootingParameters. +func (q *QueryTroubleshootingParameters) 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 "targetResourceId": + err = unpopulate(val, "TargetResourceID", &q.TargetResourceID) + 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 RadiusServer. +func (r RadiusServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "radiusServerAddress", r.RadiusServerAddress) + populate(objectMap, "radiusServerScore", r.RadiusServerScore) + populate(objectMap, "radiusServerSecret", r.RadiusServerSecret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RadiusServer. +func (r *RadiusServer) 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 "radiusServerAddress": + err = unpopulate(val, "RadiusServerAddress", &r.RadiusServerAddress) + delete(rawMsg, key) + case "radiusServerScore": + err = unpopulate(val, "RadiusServerScore", &r.RadiusServerScore) + delete(rawMsg, key) + case "radiusServerSecret": + err = unpopulate(val, "RadiusServerSecret", &r.RadiusServerSecret) + 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 RecordSet. +func (r RecordSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", r.Fqdn) + populate(objectMap, "ipAddresses", r.IPAddresses) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "recordSetName", r.RecordSetName) + populate(objectMap, "recordType", r.RecordType) + populate(objectMap, "ttl", r.TTL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSet. +func (r *RecordSet) 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 "fqdn": + err = unpopulate(val, "Fqdn", &r.Fqdn) + delete(rawMsg, key) + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &r.IPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "recordSetName": + err = unpopulate(val, "RecordSetName", &r.RecordSetName) + delete(rawMsg, key) + case "recordType": + err = unpopulate(val, "RecordType", &r.RecordType) + delete(rawMsg, key) + case "ttl": + err = unpopulate(val, "TTL", &r.TTL) + 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 ReferencedPublicIPAddress. +func (r ReferencedPublicIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReferencedPublicIPAddress. +func (r *ReferencedPublicIPAddress) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, 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, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + 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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 ResourceNavigationLink. +func (r ResourceNavigationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLink. +func (r *ResourceNavigationLink) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 ResourceNavigationLinkFormat. +func (r ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "link", r.Link) + populate(objectMap, "linkedResourceType", r.LinkedResourceType) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLinkFormat. +func (r *ResourceNavigationLinkFormat) 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 "link": + err = unpopulate(val, "Link", &r.Link) + delete(rawMsg, key) + case "linkedResourceType": + err = unpopulate(val, "LinkedResourceType", &r.LinkedResourceType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + 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 ResourceNavigationLinksListResult. +func (r ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceNavigationLinksListResult. +func (r *ResourceNavigationLinksListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 ResourceSet. +func (r ResourceSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", r.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSet. +func (r *ResourceSet) 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 "subscriptions": + err = unpopulate(val, "Subscriptions", &r.Subscriptions) + 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 RetentionPolicyParameters. +func (r RetentionPolicyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "days", r.Days) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicyParameters. +func (r *RetentionPolicyParameters) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Route. +func (r Route) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Route. +func (r *Route) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RouteFilter. +func (r RouteFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilter. +func (r *RouteFilter) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 RouteFilterListResult. +func (r RouteFilterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterListResult. +func (r *RouteFilterListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RouteFilterPropertiesFormat. +func (r RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipv6Peerings", r.IPv6Peerings) + populate(objectMap, "peerings", r.Peerings) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "rules", r.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterPropertiesFormat. +func (r *RouteFilterPropertiesFormat) 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 "ipv6Peerings": + err = unpopulate(val, "IPv6Peerings", &r.IPv6Peerings) + delete(rawMsg, key) + case "peerings": + err = unpopulate(val, "Peerings", &r.Peerings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &r.Rules) + 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 RouteFilterRule. +func (r RouteFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRule. +func (r *RouteFilterRule) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RouteFilterRuleListResult. +func (r RouteFilterRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRuleListResult. +func (r *RouteFilterRuleListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RouteFilterRulePropertiesFormat. +func (r RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", r.Access) + populate(objectMap, "communities", r.Communities) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "routeFilterRuleType", r.RouteFilterRuleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteFilterRulePropertiesFormat. +func (r *RouteFilterRulePropertiesFormat) 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 "access": + err = unpopulate(val, "Access", &r.Access) + delete(rawMsg, key) + case "communities": + err = unpopulate(val, "Communities", &r.Communities) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "routeFilterRuleType": + err = unpopulate(val, "RouteFilterRuleType", &r.RouteFilterRuleType) + 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 RouteListResult. +func (r RouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteListResult. +func (r *RouteListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RouteMap. +func (r RouteMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteMap. +func (r *RouteMap) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RouteMapProperties. +func (r RouteMapProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedInboundConnections", r.AssociatedInboundConnections) + populate(objectMap, "associatedOutboundConnections", r.AssociatedOutboundConnections) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "rules", r.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteMapProperties. +func (r *RouteMapProperties) 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 "associatedInboundConnections": + err = unpopulate(val, "AssociatedInboundConnections", &r.AssociatedInboundConnections) + delete(rawMsg, key) + case "associatedOutboundConnections": + err = unpopulate(val, "AssociatedOutboundConnections", &r.AssociatedOutboundConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &r.Rules) + 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 RouteMapRule. +func (r RouteMapRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actions", r.Actions) + populate(objectMap, "matchCriteria", r.MatchCriteria) + populate(objectMap, "name", r.Name) + populate(objectMap, "nextStepIfMatched", r.NextStepIfMatched) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteMapRule. +func (r *RouteMapRule) 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 "actions": + err = unpopulate(val, "Actions", &r.Actions) + delete(rawMsg, key) + case "matchCriteria": + err = unpopulate(val, "MatchCriteria", &r.MatchCriteria) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "nextStepIfMatched": + err = unpopulate(val, "NextStepIfMatched", &r.NextStepIfMatched) + 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 RoutePropertiesFormat. +func (r RoutePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", r.AddressPrefix) + populate(objectMap, "hasBgpOverride", r.HasBgpOverride) + populate(objectMap, "nextHopIpAddress", r.NextHopIPAddress) + populate(objectMap, "nextHopType", r.NextHopType) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutePropertiesFormat. +func (r *RoutePropertiesFormat) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &r.AddressPrefix) + delete(rawMsg, key) + case "hasBgpOverride": + err = unpopulate(val, "HasBgpOverride", &r.HasBgpOverride) + delete(rawMsg, key) + case "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &r.NextHopIPAddress) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &r.NextHopType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + 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 RouteTable. +func (r RouteTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTable. +func (r *RouteTable) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 RouteTableListResult. +func (r RouteTableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTableListResult. +func (r *RouteTableListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RouteTablePropertiesFormat. +func (r RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableBgpRoutePropagation", r.DisableBgpRoutePropagation) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "resourceGuid", r.ResourceGUID) + populate(objectMap, "routes", r.Routes) + populate(objectMap, "subnets", r.Subnets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTablePropertiesFormat. +func (r *RouteTablePropertiesFormat) 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 "disableBgpRoutePropagation": + err = unpopulate(val, "DisableBgpRoutePropagation", &r.DisableBgpRoutePropagation) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &r.ResourceGUID) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &r.Routes) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &r.Subnets) + 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 RoutingConfiguration. +func (r RoutingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedRouteTable", r.AssociatedRouteTable) + populate(objectMap, "inboundRouteMap", r.InboundRouteMap) + populate(objectMap, "outboundRouteMap", r.OutboundRouteMap) + populate(objectMap, "propagatedRouteTables", r.PropagatedRouteTables) + populate(objectMap, "vnetRoutes", r.VnetRoutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingConfiguration. +func (r *RoutingConfiguration) 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 "associatedRouteTable": + err = unpopulate(val, "AssociatedRouteTable", &r.AssociatedRouteTable) + delete(rawMsg, key) + case "inboundRouteMap": + err = unpopulate(val, "InboundRouteMap", &r.InboundRouteMap) + delete(rawMsg, key) + case "outboundRouteMap": + err = unpopulate(val, "OutboundRouteMap", &r.OutboundRouteMap) + delete(rawMsg, key) + case "propagatedRouteTables": + err = unpopulate(val, "PropagatedRouteTables", &r.PropagatedRouteTables) + delete(rawMsg, key) + case "vnetRoutes": + err = unpopulate(val, "VnetRoutes", &r.VnetRoutes) + 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 RoutingIntent. +func (r RoutingIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIntent. +func (r *RoutingIntent) 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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RoutingIntentProperties. +func (r RoutingIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "routingPolicies", r.RoutingPolicies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIntentProperties. +func (r *RoutingIntentProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "routingPolicies": + err = unpopulate(val, "RoutingPolicies", &r.RoutingPolicies) + 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 RoutingPolicy. +func (r RoutingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinations", r.Destinations) + populate(objectMap, "name", r.Name) + populate(objectMap, "nextHop", r.NextHop) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingPolicy. +func (r *RoutingPolicy) 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 "destinations": + err = unpopulate(val, "Destinations", &r.Destinations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "nextHop": + err = unpopulate(val, "NextHop", &r.NextHop) + 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 Rule. +func (r Rule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "destinationAddresses", r.DestinationAddresses) + populate(objectMap, "destinationFqdns", r.DestinationFqdns) + populate(objectMap, "destinationIpGroups", r.DestinationIPGroups) + populate(objectMap, "destinationPorts", r.DestinationPorts) + populate(objectMap, "ipProtocols", r.IPProtocols) + populate(objectMap, "name", r.Name) + objectMap["ruleType"] = FirewallPolicyRuleTypeNetworkRule + populate(objectMap, "sourceAddresses", r.SourceAddresses) + populate(objectMap, "sourceIpGroups", r.SourceIPGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Rule. +func (r *Rule) 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 "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &r.DestinationAddresses) + delete(rawMsg, key) + case "destinationFqdns": + err = unpopulate(val, "DestinationFqdns", &r.DestinationFqdns) + delete(rawMsg, key) + case "destinationIpGroups": + err = unpopulate(val, "DestinationIPGroups", &r.DestinationIPGroups) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &r.DestinationPorts) + delete(rawMsg, key) + case "ipProtocols": + err = unpopulate(val, "IPProtocols", &r.IPProtocols) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &r.RuleType) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &r.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &r.SourceIPGroups) + 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) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScopeConnection. +func (s ScopeConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnection. +func (s *ScopeConnection) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ScopeConnectionListResult. +func (s ScopeConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnectionListResult. +func (s *ScopeConnectionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 ScopeConnectionProperties. +func (s ScopeConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionState", s.ConnectionState) + populate(objectMap, "description", s.Description) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeConnectionProperties. +func (s *ScopeConnectionProperties) 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 "connectionState": + err = unpopulate(val, "ConnectionState", &s.ConnectionState) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + 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 SecurityAdminConfiguration. +func (s SecurityAdminConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfiguration. +func (s *SecurityAdminConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SecurityAdminConfigurationListResult. +func (s SecurityAdminConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfigurationListResult. +func (s *SecurityAdminConfigurationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 SecurityAdminConfigurationPropertiesFormat. +func (s SecurityAdminConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applyOnNetworkIntentPolicyBasedServices", s.ApplyOnNetworkIntentPolicyBasedServices) + populate(objectMap, "description", s.Description) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAdminConfigurationPropertiesFormat. +func (s *SecurityAdminConfigurationPropertiesFormat) 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 "applyOnNetworkIntentPolicyBasedServices": + err = unpopulate(val, "ApplyOnNetworkIntentPolicyBasedServices", &s.ApplyOnNetworkIntentPolicyBasedServices) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 SecurityGroup. +func (s SecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroup. +func (s *SecurityGroup) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SecurityGroupListResult. +func (s SecurityGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupListResult. +func (s *SecurityGroupListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 SecurityGroupNetworkInterface. +func (s SecurityGroupNetworkInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "securityRuleAssociations", s.SecurityRuleAssociations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupNetworkInterface. +func (s *SecurityGroupNetworkInterface) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "securityRuleAssociations": + err = unpopulate(val, "SecurityRuleAssociations", &s.SecurityRuleAssociations) + 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 SecurityGroupPropertiesFormat. +func (s SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultSecurityRules", s.DefaultSecurityRules) + populate(objectMap, "flowLogs", s.FlowLogs) + populate(objectMap, "flushConnection", s.FlushConnection) + populate(objectMap, "networkInterfaces", s.NetworkInterfaces) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "resourceGuid", s.ResourceGUID) + populate(objectMap, "securityRules", s.SecurityRules) + populate(objectMap, "subnets", s.Subnets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupPropertiesFormat. +func (s *SecurityGroupPropertiesFormat) 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 "defaultSecurityRules": + err = unpopulate(val, "DefaultSecurityRules", &s.DefaultSecurityRules) + delete(rawMsg, key) + case "flowLogs": + err = unpopulate(val, "FlowLogs", &s.FlowLogs) + delete(rawMsg, key) + case "flushConnection": + err = unpopulate(val, "FlushConnection", &s.FlushConnection) + delete(rawMsg, key) + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &s.NetworkInterfaces) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &s.ResourceGUID) + delete(rawMsg, key) + case "securityRules": + err = unpopulate(val, "SecurityRules", &s.SecurityRules) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &s.Subnets) + 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 SecurityGroupResult. +func (s SecurityGroupResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "evaluatedNetworkSecurityGroups", s.EvaluatedNetworkSecurityGroups) + populate(objectMap, "securityRuleAccessResult", s.SecurityRuleAccessResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupResult. +func (s *SecurityGroupResult) 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 "evaluatedNetworkSecurityGroups": + err = unpopulate(val, "EvaluatedNetworkSecurityGroups", &s.EvaluatedNetworkSecurityGroups) + delete(rawMsg, key) + case "securityRuleAccessResult": + err = unpopulate(val, "SecurityRuleAccessResult", &s.SecurityRuleAccessResult) + 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 SecurityGroupViewParameters. +func (s SecurityGroupViewParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetResourceId", s.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupViewParameters. +func (s *SecurityGroupViewParameters) 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 "targetResourceId": + err = unpopulate(val, "TargetResourceID", &s.TargetResourceID) + 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 SecurityGroupViewResult. +func (s SecurityGroupViewResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkInterfaces", s.NetworkInterfaces) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupViewResult. +func (s *SecurityGroupViewResult) 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 "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &s.NetworkInterfaces) + 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 SecurityPartnerProvider. +func (s SecurityPartnerProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProvider. +func (s *SecurityPartnerProvider) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SecurityPartnerProviderListResult. +func (s SecurityPartnerProviderListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProviderListResult. +func (s *SecurityPartnerProviderListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 SecurityPartnerProviderPropertiesFormat. +func (s SecurityPartnerProviderPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionStatus", s.ConnectionStatus) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "securityProviderName", s.SecurityProviderName) + populate(objectMap, "virtualHub", s.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPartnerProviderPropertiesFormat. +func (s *SecurityPartnerProviderPropertiesFormat) 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 "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &s.ConnectionStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "securityProviderName": + err = unpopulate(val, "SecurityProviderName", &s.SecurityProviderName) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &s.VirtualHub) + 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 SecurityRule. +func (s SecurityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRule. +func (s *SecurityRule) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SecurityRuleAssociations. +func (s SecurityRuleAssociations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultSecurityRules", s.DefaultSecurityRules) + populate(objectMap, "effectiveSecurityRules", s.EffectiveSecurityRules) + populate(objectMap, "networkInterfaceAssociation", s.NetworkInterfaceAssociation) + populate(objectMap, "subnetAssociation", s.SubnetAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRuleAssociations. +func (s *SecurityRuleAssociations) 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 "defaultSecurityRules": + err = unpopulate(val, "DefaultSecurityRules", &s.DefaultSecurityRules) + delete(rawMsg, key) + case "effectiveSecurityRules": + err = unpopulate(val, "EffectiveSecurityRules", &s.EffectiveSecurityRules) + delete(rawMsg, key) + case "networkInterfaceAssociation": + err = unpopulate(val, "NetworkInterfaceAssociation", &s.NetworkInterfaceAssociation) + delete(rawMsg, key) + case "subnetAssociation": + err = unpopulate(val, "SubnetAssociation", &s.SubnetAssociation) + 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 SecurityRuleListResult. +func (s SecurityRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRuleListResult. +func (s *SecurityRuleListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 SecurityRulePropertiesFormat. +func (s SecurityRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", s.Access) + populate(objectMap, "description", s.Description) + populate(objectMap, "destinationAddressPrefix", s.DestinationAddressPrefix) + populate(objectMap, "destinationAddressPrefixes", s.DestinationAddressPrefixes) + populate(objectMap, "destinationApplicationSecurityGroups", s.DestinationApplicationSecurityGroups) + populate(objectMap, "destinationPortRange", s.DestinationPortRange) + populate(objectMap, "destinationPortRanges", s.DestinationPortRanges) + populate(objectMap, "direction", s.Direction) + populate(objectMap, "priority", s.Priority) + populate(objectMap, "protocol", s.Protocol) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "sourceAddressPrefix", s.SourceAddressPrefix) + populate(objectMap, "sourceAddressPrefixes", s.SourceAddressPrefixes) + populate(objectMap, "sourceApplicationSecurityGroups", s.SourceApplicationSecurityGroups) + populate(objectMap, "sourcePortRange", s.SourcePortRange) + populate(objectMap, "sourcePortRanges", s.SourcePortRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRulePropertiesFormat. +func (s *SecurityRulePropertiesFormat) 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 "access": + err = unpopulate(val, "Access", &s.Access) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "destinationAddressPrefix": + err = unpopulate(val, "DestinationAddressPrefix", &s.DestinationAddressPrefix) + delete(rawMsg, key) + case "destinationAddressPrefixes": + err = unpopulate(val, "DestinationAddressPrefixes", &s.DestinationAddressPrefixes) + delete(rawMsg, key) + case "destinationApplicationSecurityGroups": + err = unpopulate(val, "DestinationApplicationSecurityGroups", &s.DestinationApplicationSecurityGroups) + delete(rawMsg, key) + case "destinationPortRange": + err = unpopulate(val, "DestinationPortRange", &s.DestinationPortRange) + delete(rawMsg, key) + case "destinationPortRanges": + err = unpopulate(val, "DestinationPortRanges", &s.DestinationPortRanges) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &s.Direction) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &s.Priority) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &s.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "sourceAddressPrefix": + err = unpopulate(val, "SourceAddressPrefix", &s.SourceAddressPrefix) + delete(rawMsg, key) + case "sourceAddressPrefixes": + err = unpopulate(val, "SourceAddressPrefixes", &s.SourceAddressPrefixes) + delete(rawMsg, key) + case "sourceApplicationSecurityGroups": + err = unpopulate(val, "SourceApplicationSecurityGroups", &s.SourceApplicationSecurityGroups) + delete(rawMsg, key) + case "sourcePortRange": + err = unpopulate(val, "SourcePortRange", &s.SourcePortRange) + delete(rawMsg, key) + case "sourcePortRanges": + err = unpopulate(val, "SourcePortRanges", &s.SourcePortRanges) + 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 SecurityRulesEvaluationResult. +func (s SecurityRulesEvaluationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationMatched", s.DestinationMatched) + populate(objectMap, "destinationPortMatched", s.DestinationPortMatched) + populate(objectMap, "name", s.Name) + populate(objectMap, "protocolMatched", s.ProtocolMatched) + populate(objectMap, "sourceMatched", s.SourceMatched) + populate(objectMap, "sourcePortMatched", s.SourcePortMatched) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityRulesEvaluationResult. +func (s *SecurityRulesEvaluationResult) 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 "destinationMatched": + err = unpopulate(val, "DestinationMatched", &s.DestinationMatched) + delete(rawMsg, key) + case "destinationPortMatched": + err = unpopulate(val, "DestinationPortMatched", &s.DestinationPortMatched) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "protocolMatched": + err = unpopulate(val, "ProtocolMatched", &s.ProtocolMatched) + delete(rawMsg, key) + case "sourceMatched": + err = unpopulate(val, "SourceMatched", &s.SourceMatched) + delete(rawMsg, key) + case "sourcePortMatched": + err = unpopulate(val, "SourcePortMatched", &s.SourcePortMatched) + 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 ServiceAssociationLink. +func (s ServiceAssociationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLink. +func (s *ServiceAssociationLink) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceAssociationLinkPropertiesFormat. +func (s ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowDelete", s.AllowDelete) + populate(objectMap, "link", s.Link) + populate(objectMap, "linkedResourceType", s.LinkedResourceType) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLinkPropertiesFormat. +func (s *ServiceAssociationLinkPropertiesFormat) 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 "allowDelete": + err = unpopulate(val, "AllowDelete", &s.AllowDelete) + delete(rawMsg, key) + case "link": + err = unpopulate(val, "Link", &s.Link) + delete(rawMsg, key) + case "linkedResourceType": + err = unpopulate(val, "LinkedResourceType", &s.LinkedResourceType) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 ServiceAssociationLinksListResult. +func (s ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceAssociationLinksListResult. +func (s *ServiceAssociationLinksListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 ServiceDelegationPropertiesFormat. +func (s ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actions", s.Actions) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceName", s.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDelegationPropertiesFormat. +func (s *ServiceDelegationPropertiesFormat) 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 "actions": + err = unpopulate(val, "Actions", &s.Actions) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &s.ServiceName) + 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 ServiceEndpointPolicy. +func (s ServiceEndpointPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicy. +func (s *ServiceEndpointPolicy) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceEndpointPolicyDefinition. +func (s ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinition. +func (s *ServiceEndpointPolicyDefinition) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceEndpointPolicyDefinitionListResult. +func (s ServiceEndpointPolicyDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinitionListResult. +func (s *ServiceEndpointPolicyDefinitionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 ServiceEndpointPolicyDefinitionPropertiesFormat. +func (s ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "service", s.Service) + populate(objectMap, "serviceResources", s.ServiceResources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyDefinitionPropertiesFormat. +func (s *ServiceEndpointPolicyDefinitionPropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "service": + err = unpopulate(val, "Service", &s.Service) + delete(rawMsg, key) + case "serviceResources": + err = unpopulate(val, "ServiceResources", &s.ServiceResources) + 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 ServiceEndpointPolicyListResult. +func (s ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyListResult. +func (s *ServiceEndpointPolicyListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 ServiceEndpointPolicyPropertiesFormat. +func (s ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contextualServiceEndpointPolicies", s.ContextualServiceEndpointPolicies) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "resourceGuid", s.ResourceGUID) + populate(objectMap, "serviceAlias", s.ServiceAlias) + populate(objectMap, "serviceEndpointPolicyDefinitions", s.ServiceEndpointPolicyDefinitions) + populate(objectMap, "subnets", s.Subnets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPolicyPropertiesFormat. +func (s *ServiceEndpointPolicyPropertiesFormat) 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 "contextualServiceEndpointPolicies": + err = unpopulate(val, "ContextualServiceEndpointPolicies", &s.ContextualServiceEndpointPolicies) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &s.ResourceGUID) + delete(rawMsg, key) + case "serviceAlias": + err = unpopulate(val, "ServiceAlias", &s.ServiceAlias) + delete(rawMsg, key) + case "serviceEndpointPolicyDefinitions": + err = unpopulate(val, "ServiceEndpointPolicyDefinitions", &s.ServiceEndpointPolicyDefinitions) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &s.Subnets) + 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 ServiceEndpointPropertiesFormat. +func (s ServiceEndpointPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "service", s.Service) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceEndpointPropertiesFormat. +func (s *ServiceEndpointPropertiesFormat) 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 "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "service": + err = unpopulate(val, "Service", &s.Service) + 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 ServiceTagInformation. +func (s ServiceTagInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "serviceTagChangeNumber", s.ServiceTagChangeNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformation. +func (s *ServiceTagInformation) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "serviceTagChangeNumber": + err = unpopulate(val, "ServiceTagChangeNumber", &s.ServiceTagChangeNumber) + 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 ServiceTagInformationListResult. +func (s ServiceTagInformationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformationListResult. +func (s *ServiceTagInformationListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 ServiceTagInformationPropertiesFormat. +func (s ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", s.AddressPrefixes) + populate(objectMap, "changeNumber", s.ChangeNumber) + populate(objectMap, "region", s.Region) + populate(objectMap, "state", s.State) + populate(objectMap, "systemService", s.SystemService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagInformationPropertiesFormat. +func (s *ServiceTagInformationPropertiesFormat) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) + delete(rawMsg, key) + case "changeNumber": + err = unpopulate(val, "ChangeNumber", &s.ChangeNumber) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &s.Region) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "systemService": + err = unpopulate(val, "SystemService", &s.SystemService) + 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 ServiceTagsListResult. +func (s ServiceTagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "changeNumber", s.ChangeNumber) + populate(objectMap, "cloud", s.Cloud) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "type", s.Type) + populate(objectMap, "values", s.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagsListResult. +func (s *ServiceTagsListResult) 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 "changeNumber": + err = unpopulate(val, "ChangeNumber", &s.ChangeNumber) + delete(rawMsg, key) + case "cloud": + err = unpopulate(val, "Cloud", &s.Cloud) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) + 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 SessionIDs. +func (s SessionIDs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sessionIds", s.SessionIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionIDs. +func (s *SessionIDs) 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 "sessionIds": + err = unpopulate(val, "SessionIDs", &s.SessionIDs) + 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 SignatureOverridesFilterValuesQuery. +func (s SignatureOverridesFilterValuesQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterName", s.FilterName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SignatureOverridesFilterValuesQuery. +func (s *SignatureOverridesFilterValuesQuery) 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 "filterName": + err = unpopulate(val, "FilterName", &s.FilterName) + 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 SignatureOverridesFilterValuesResponse. +func (s SignatureOverridesFilterValuesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterValues", s.FilterValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SignatureOverridesFilterValuesResponse. +func (s *SignatureOverridesFilterValuesResponse) 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 "filterValues": + err = unpopulate(val, "FilterValues", &s.FilterValues) + 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 SignaturesOverrides. +func (s SignaturesOverrides) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SignaturesOverrides. +func (s *SignaturesOverrides) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SignaturesOverridesList. +func (s SignaturesOverridesList) 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 SignaturesOverridesList. +func (s *SignaturesOverridesList) 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 SignaturesOverridesProperties. +func (s SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "signatures", s.Signatures) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SignaturesOverridesProperties. +func (s *SignaturesOverridesProperties) 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 "signatures": + err = unpopulate(val, "Signatures", &s.Signatures) + 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 SingleQueryResult. +func (s SingleQueryResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populate(objectMap, "destinationPorts", s.DestinationPorts) + populate(objectMap, "direction", s.Direction) + populate(objectMap, "group", s.Group) + populate(objectMap, "inheritedFromParentPolicy", s.InheritedFromParentPolicy) + populate(objectMap, "lastUpdated", s.LastUpdated) + populate(objectMap, "mode", s.Mode) + populate(objectMap, "protocol", s.Protocol) + populate(objectMap, "severity", s.Severity) + populate(objectMap, "signatureId", s.SignatureID) + populate(objectMap, "sourcePorts", s.SourcePorts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleQueryResult. +func (s *SingleQueryResult) 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 "destinationPorts": + err = unpopulate(val, "DestinationPorts", &s.DestinationPorts) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &s.Direction) + delete(rawMsg, key) + case "group": + err = unpopulate(val, "Group", &s.Group) + delete(rawMsg, key) + case "inheritedFromParentPolicy": + err = unpopulate(val, "InheritedFromParentPolicy", &s.InheritedFromParentPolicy) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulate(val, "LastUpdated", &s.LastUpdated) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &s.Mode) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &s.Protocol) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &s.Severity) + delete(rawMsg, key) + case "signatureId": + err = unpopulate(val, "SignatureID", &s.SignatureID) + delete(rawMsg, key) + case "sourcePorts": + err = unpopulate(val, "SourcePorts", &s.SourcePorts) + 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 StaticMember. +func (s StaticMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMember. +func (s *StaticMember) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 StaticMemberListResult. +func (s StaticMemberListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMemberListResult. +func (s *StaticMemberListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 StaticMemberProperties. +func (s StaticMemberProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "region", s.Region) + populate(objectMap, "resourceId", s.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticMemberProperties. +func (s *StaticMemberProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &s.Region) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + 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 StaticRoute. +func (s StaticRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", s.AddressPrefixes) + populate(objectMap, "name", s.Name) + populate(objectMap, "nextHopIpAddress", s.NextHopIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticRoute. +func (s *StaticRoute) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &s.NextHopIPAddress) + 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 StaticRoutesConfig. +func (s StaticRoutesConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "propagateStaticRoutes", s.PropagateStaticRoutes) + populate(objectMap, "vnetLocalRouteOverrideCriteria", s.VnetLocalRouteOverrideCriteria) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticRoutesConfig. +func (s *StaticRoutesConfig) 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 "propagateStaticRoutes": + err = unpopulate(val, "PropagateStaticRoutes", &s.PropagateStaticRoutes) + delete(rawMsg, key) + case "vnetLocalRouteOverrideCriteria": + err = unpopulate(val, "VnetLocalRouteOverrideCriteria", &s.VnetLocalRouteOverrideCriteria) + 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 SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) 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 "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 Subnet. +func (s Subnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. +func (s *Subnet) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SubnetAssociation. +func (s SubnetAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "securityRules", s.SecurityRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetAssociation. +func (s *SubnetAssociation) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "securityRules": + err = unpopulate(val, "SecurityRules", &s.SecurityRules) + 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 SubnetListResult. +func (s SubnetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetListResult. +func (s *SubnetListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + 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 SubnetPropertiesFormat. +func (s SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", s.AddressPrefix) + populate(objectMap, "addressPrefixes", s.AddressPrefixes) + populate(objectMap, "applicationGatewayIpConfigurations", s.ApplicationGatewayIPConfigurations) + populate(objectMap, "delegations", s.Delegations) + populate(objectMap, "ipAllocations", s.IPAllocations) + populate(objectMap, "ipConfigurationProfiles", s.IPConfigurationProfiles) + populate(objectMap, "ipConfigurations", s.IPConfigurations) + populate(objectMap, "natGateway", s.NatGateway) + populate(objectMap, "networkSecurityGroup", s.NetworkSecurityGroup) + populate(objectMap, "privateEndpointNetworkPolicies", s.PrivateEndpointNetworkPolicies) + populate(objectMap, "privateEndpoints", s.PrivateEndpoints) + populate(objectMap, "privateLinkServiceNetworkPolicies", s.PrivateLinkServiceNetworkPolicies) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "purpose", s.Purpose) + populate(objectMap, "resourceNavigationLinks", s.ResourceNavigationLinks) + populate(objectMap, "routeTable", s.RouteTable) + populate(objectMap, "serviceAssociationLinks", s.ServiceAssociationLinks) + populate(objectMap, "serviceEndpointPolicies", s.ServiceEndpointPolicies) + populate(objectMap, "serviceEndpoints", s.ServiceEndpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubnetPropertiesFormat. +func (s *SubnetPropertiesFormat) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &s.AddressPrefix) + delete(rawMsg, key) + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) + delete(rawMsg, key) + case "applicationGatewayIpConfigurations": + err = unpopulate(val, "ApplicationGatewayIPConfigurations", &s.ApplicationGatewayIPConfigurations) + delete(rawMsg, key) + case "delegations": + err = unpopulate(val, "Delegations", &s.Delegations) + delete(rawMsg, key) + case "ipAllocations": + err = unpopulate(val, "IPAllocations", &s.IPAllocations) + delete(rawMsg, key) + case "ipConfigurationProfiles": + err = unpopulate(val, "IPConfigurationProfiles", &s.IPConfigurationProfiles) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &s.IPConfigurations) + delete(rawMsg, key) + case "natGateway": + err = unpopulate(val, "NatGateway", &s.NatGateway) + delete(rawMsg, key) + case "networkSecurityGroup": + err = unpopulate(val, "NetworkSecurityGroup", &s.NetworkSecurityGroup) + delete(rawMsg, key) + case "privateEndpointNetworkPolicies": + err = unpopulate(val, "PrivateEndpointNetworkPolicies", &s.PrivateEndpointNetworkPolicies) + delete(rawMsg, key) + case "privateEndpoints": + err = unpopulate(val, "PrivateEndpoints", &s.PrivateEndpoints) + delete(rawMsg, key) + case "privateLinkServiceNetworkPolicies": + err = unpopulate(val, "PrivateLinkServiceNetworkPolicies", &s.PrivateLinkServiceNetworkPolicies) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "purpose": + err = unpopulate(val, "Purpose", &s.Purpose) + delete(rawMsg, key) + case "resourceNavigationLinks": + err = unpopulate(val, "ResourceNavigationLinks", &s.ResourceNavigationLinks) + delete(rawMsg, key) + case "routeTable": + err = unpopulate(val, "RouteTable", &s.RouteTable) + delete(rawMsg, key) + case "serviceAssociationLinks": + err = unpopulate(val, "ServiceAssociationLinks", &s.ServiceAssociationLinks) + delete(rawMsg, key) + case "serviceEndpointPolicies": + err = unpopulate(val, "ServiceEndpointPolicies", &s.ServiceEndpointPolicies) + delete(rawMsg, key) + case "serviceEndpoints": + err = unpopulate(val, "ServiceEndpoints", &s.ServiceEndpoints) + 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 SwapResource. +func (s SwapResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SwapResource. +func (s *SwapResource) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SwapResourceListResult. +func (s SwapResourceListResult) 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 SwapResourceListResult. +func (s *SwapResourceListResult) 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 SwapResourceProperties. +func (s SwapResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "slotType", s.SlotType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SwapResourceProperties. +func (s *SwapResourceProperties) 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 "slotType": + err = unpopulate(val, "SlotType", &s.SlotType) + 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) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 = unpopulateTimeRFC3339(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 TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. +func (t *TagsObject) 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 "tags": + err = unpopulate(val, "Tags", &t.Tags) + 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 Topology. +func (t Topology) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdDateTime", t.CreatedDateTime) + populate(objectMap, "id", t.ID) + populateTimeRFC3339(objectMap, "lastModified", t.LastModified) + populate(objectMap, "resources", t.Resources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Topology. +func (t *Topology) 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 "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &t.CreatedDateTime) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &t.LastModified) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &t.Resources) + 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 TopologyAssociation. +func (t TopologyAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associationType", t.AssociationType) + populate(objectMap, "name", t.Name) + populate(objectMap, "resourceId", t.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyAssociation. +func (t *TopologyAssociation) 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 "associationType": + err = unpopulate(val, "AssociationType", &t.AssociationType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &t.ResourceID) + 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 TopologyParameters. +func (t TopologyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetResourceGroupName", t.TargetResourceGroupName) + populate(objectMap, "targetSubnet", t.TargetSubnet) + populate(objectMap, "targetVirtualNetwork", t.TargetVirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyParameters. +func (t *TopologyParameters) 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 "targetResourceGroupName": + err = unpopulate(val, "TargetResourceGroupName", &t.TargetResourceGroupName) + delete(rawMsg, key) + case "targetSubnet": + err = unpopulate(val, "TargetSubnet", &t.TargetSubnet) + delete(rawMsg, key) + case "targetVirtualNetwork": + err = unpopulate(val, "TargetVirtualNetwork", &t.TargetVirtualNetwork) + 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 TopologyResource. +func (t TopologyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associations", t.Associations) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopologyResource. +func (t *TopologyResource) 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 "associations": + err = unpopulate(val, "Associations", &t.Associations) + delete(rawMsg, 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrafficAnalyticsConfigurationProperties. +func (t TrafficAnalyticsConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", t.Enabled) + populate(objectMap, "trafficAnalyticsInterval", t.TrafficAnalyticsInterval) + populate(objectMap, "workspaceId", t.WorkspaceID) + populate(objectMap, "workspaceRegion", t.WorkspaceRegion) + populate(objectMap, "workspaceResourceId", t.WorkspaceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficAnalyticsConfigurationProperties. +func (t *TrafficAnalyticsConfigurationProperties) 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 "enabled": + err = unpopulate(val, "Enabled", &t.Enabled) + delete(rawMsg, key) + case "trafficAnalyticsInterval": + err = unpopulate(val, "TrafficAnalyticsInterval", &t.TrafficAnalyticsInterval) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &t.WorkspaceID) + delete(rawMsg, key) + case "workspaceRegion": + err = unpopulate(val, "WorkspaceRegion", &t.WorkspaceRegion) + delete(rawMsg, key) + case "workspaceResourceId": + err = unpopulate(val, "WorkspaceResourceID", &t.WorkspaceResourceID) + 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 TrafficAnalyticsProperties. +func (t TrafficAnalyticsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkWatcherFlowAnalyticsConfiguration", t.NetworkWatcherFlowAnalyticsConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficAnalyticsProperties. +func (t *TrafficAnalyticsProperties) 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 "networkWatcherFlowAnalyticsConfiguration": + err = unpopulate(val, "NetworkWatcherFlowAnalyticsConfiguration", &t.NetworkWatcherFlowAnalyticsConfiguration) + 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 TrafficSelectorPolicy. +func (t TrafficSelectorPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localAddressRanges", t.LocalAddressRanges) + populate(objectMap, "remoteAddressRanges", t.RemoteAddressRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrafficSelectorPolicy. +func (t *TrafficSelectorPolicy) 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 "localAddressRanges": + err = unpopulate(val, "LocalAddressRanges", &t.LocalAddressRanges) + delete(rawMsg, key) + case "remoteAddressRanges": + err = unpopulate(val, "RemoteAddressRanges", &t.RemoteAddressRanges) + 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 TroubleshootingDetails. +func (t TroubleshootingDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "detail", t.Detail) + populate(objectMap, "id", t.ID) + populate(objectMap, "reasonType", t.ReasonType) + populate(objectMap, "recommendedActions", t.RecommendedActions) + populate(objectMap, "summary", t.Summary) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingDetails. +func (t *TroubleshootingDetails) 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 "detail": + err = unpopulate(val, "Detail", &t.Detail) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "reasonType": + err = unpopulate(val, "ReasonType", &t.ReasonType) + delete(rawMsg, key) + case "recommendedActions": + err = unpopulate(val, "RecommendedActions", &t.RecommendedActions) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, "Summary", &t.Summary) + 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 TroubleshootingParameters. +func (t TroubleshootingParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "targetResourceId", t.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingParameters. +func (t *TroubleshootingParameters) 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) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &t.TargetResourceID) + 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 TroubleshootingProperties. +func (t TroubleshootingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "storageId", t.StorageID) + populate(objectMap, "storagePath", t.StoragePath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingProperties. +func (t *TroubleshootingProperties) 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 "storageId": + err = unpopulate(val, "StorageID", &t.StorageID) + delete(rawMsg, key) + case "storagePath": + err = unpopulate(val, "StoragePath", &t.StoragePath) + 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 TroubleshootingRecommendedActions. +func (t TroubleshootingRecommendedActions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionId", t.ActionID) + populate(objectMap, "actionText", t.ActionText) + populate(objectMap, "actionUri", t.ActionURI) + populate(objectMap, "actionUriText", t.ActionURIText) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingRecommendedActions. +func (t *TroubleshootingRecommendedActions) 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 "actionId": + err = unpopulate(val, "ActionID", &t.ActionID) + delete(rawMsg, key) + case "actionText": + err = unpopulate(val, "ActionText", &t.ActionText) + delete(rawMsg, key) + case "actionUri": + err = unpopulate(val, "ActionURI", &t.ActionURI) + delete(rawMsg, key) + case "actionUriText": + err = unpopulate(val, "ActionURIText", &t.ActionURIText) + 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 TroubleshootingResult. +func (t TroubleshootingResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", t.Code) + populateTimeRFC3339(objectMap, "endTime", t.EndTime) + populate(objectMap, "results", t.Results) + populateTimeRFC3339(objectMap, "startTime", t.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TroubleshootingResult. +func (t *TroubleshootingResult) 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 "code": + err = unpopulate(val, "Code", &t.Code) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &t.EndTime) + delete(rawMsg, key) + case "results": + err = unpopulate(val, "Results", &t.Results) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(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 TunnelConnectionHealth. +func (t TunnelConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionStatus", t.ConnectionStatus) + populate(objectMap, "egressBytesTransferred", t.EgressBytesTransferred) + populate(objectMap, "ingressBytesTransferred", t.IngressBytesTransferred) + populate(objectMap, "lastConnectionEstablishedUtcTime", t.LastConnectionEstablishedUTCTime) + populate(objectMap, "tunnel", t.Tunnel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TunnelConnectionHealth. +func (t *TunnelConnectionHealth) 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 "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &t.ConnectionStatus) + delete(rawMsg, key) + case "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &t.EgressBytesTransferred) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &t.IngressBytesTransferred) + delete(rawMsg, key) + case "lastConnectionEstablishedUtcTime": + err = unpopulate(val, "LastConnectionEstablishedUTCTime", &t.LastConnectionEstablishedUTCTime) + delete(rawMsg, key) + case "tunnel": + err = unpopulate(val, "Tunnel", &t.Tunnel) + 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 UnprepareNetworkPoliciesRequest. +func (u UnprepareNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceName", u.ServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UnprepareNetworkPoliciesRequest. +func (u *UnprepareNetworkPoliciesRequest) 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 "serviceName": + err = unpopulate(val, "ServiceName", &u.ServiceName) + 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, "id", u.ID) + 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 "id": + err = unpopulate(val, "ID", &u.ID) + 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 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 UsagesListResult. +func (u UsagesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsagesListResult. +func (u *UsagesListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + 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 VM. +func (v VM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VM. +func (v *VM) 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 "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientConfiguration. +func (v VPNClientConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadAudience", v.AADAudience) + populate(objectMap, "aadIssuer", v.AADIssuer) + populate(objectMap, "aadTenant", v.AADTenant) + populate(objectMap, "radiusServerAddress", v.RadiusServerAddress) + populate(objectMap, "radiusServerSecret", v.RadiusServerSecret) + populate(objectMap, "radiusServers", v.RadiusServers) + populate(objectMap, "vpnAuthenticationTypes", v.VPNAuthenticationTypes) + populate(objectMap, "vpnClientAddressPool", v.VPNClientAddressPool) + populate(objectMap, "vpnClientIpsecPolicies", v.VPNClientIPSecPolicies) + populate(objectMap, "vpnClientProtocols", v.VPNClientProtocols) + populate(objectMap, "vpnClientRevokedCertificates", v.VPNClientRevokedCertificates) + populate(objectMap, "vpnClientRootCertificates", v.VPNClientRootCertificates) + populate(objectMap, "vngClientConnectionConfigurations", v.VngClientConnectionConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConfiguration. +func (v *VPNClientConfiguration) 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 "aadAudience": + err = unpopulate(val, "AADAudience", &v.AADAudience) + delete(rawMsg, key) + case "aadIssuer": + err = unpopulate(val, "AADIssuer", &v.AADIssuer) + delete(rawMsg, key) + case "aadTenant": + err = unpopulate(val, "AADTenant", &v.AADTenant) + delete(rawMsg, key) + case "radiusServerAddress": + err = unpopulate(val, "RadiusServerAddress", &v.RadiusServerAddress) + delete(rawMsg, key) + case "radiusServerSecret": + err = unpopulate(val, "RadiusServerSecret", &v.RadiusServerSecret) + delete(rawMsg, key) + case "radiusServers": + err = unpopulate(val, "RadiusServers", &v.RadiusServers) + delete(rawMsg, key) + case "vpnAuthenticationTypes": + err = unpopulate(val, "VPNAuthenticationTypes", &v.VPNAuthenticationTypes) + delete(rawMsg, key) + case "vpnClientAddressPool": + err = unpopulate(val, "VPNClientAddressPool", &v.VPNClientAddressPool) + delete(rawMsg, key) + case "vpnClientIpsecPolicies": + err = unpopulate(val, "VPNClientIPSecPolicies", &v.VPNClientIPSecPolicies) + delete(rawMsg, key) + case "vpnClientProtocols": + err = unpopulate(val, "VPNClientProtocols", &v.VPNClientProtocols) + delete(rawMsg, key) + case "vpnClientRevokedCertificates": + err = unpopulate(val, "VPNClientRevokedCertificates", &v.VPNClientRevokedCertificates) + delete(rawMsg, key) + case "vpnClientRootCertificates": + err = unpopulate(val, "VPNClientRootCertificates", &v.VPNClientRootCertificates) + delete(rawMsg, key) + case "vngClientConnectionConfigurations": + err = unpopulate(val, "VngClientConnectionConfigurations", &v.VngClientConnectionConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealth. +func (v VPNClientConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocatedIpAddresses", v.AllocatedIPAddresses) + populate(objectMap, "totalEgressBytesTransferred", v.TotalEgressBytesTransferred) + populate(objectMap, "totalIngressBytesTransferred", v.TotalIngressBytesTransferred) + populate(objectMap, "vpnClientConnectionsCount", v.VPNClientConnectionsCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealth. +func (v *VPNClientConnectionHealth) 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 "allocatedIpAddresses": + err = unpopulate(val, "AllocatedIPAddresses", &v.AllocatedIPAddresses) + delete(rawMsg, key) + case "totalEgressBytesTransferred": + err = unpopulate(val, "TotalEgressBytesTransferred", &v.TotalEgressBytesTransferred) + delete(rawMsg, key) + case "totalIngressBytesTransferred": + err = unpopulate(val, "TotalIngressBytesTransferred", &v.TotalIngressBytesTransferred) + delete(rawMsg, key) + case "vpnClientConnectionsCount": + err = unpopulate(val, "VPNClientConnectionsCount", &v.VPNClientConnectionsCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealthDetail. +func (v VPNClientConnectionHealthDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) + populate(objectMap, "egressPacketsTransferred", v.EgressPacketsTransferred) + populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) + populate(objectMap, "ingressPacketsTransferred", v.IngressPacketsTransferred) + populate(objectMap, "maxBandwidth", v.MaxBandwidth) + populate(objectMap, "maxPacketsPerSecond", v.MaxPacketsPerSecond) + populate(objectMap, "privateIpAddress", v.PrivateIPAddress) + populate(objectMap, "publicIpAddress", v.PublicIPAddress) + populate(objectMap, "vpnConnectionDuration", v.VPNConnectionDuration) + populate(objectMap, "vpnConnectionId", v.VPNConnectionID) + populate(objectMap, "vpnConnectionTime", v.VPNConnectionTime) + populate(objectMap, "vpnUserName", v.VPNUserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealthDetail. +func (v *VPNClientConnectionHealthDetail) 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 "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) + delete(rawMsg, key) + case "egressPacketsTransferred": + err = unpopulate(val, "EgressPacketsTransferred", &v.EgressPacketsTransferred) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) + delete(rawMsg, key) + case "ingressPacketsTransferred": + err = unpopulate(val, "IngressPacketsTransferred", &v.IngressPacketsTransferred) + delete(rawMsg, key) + case "maxBandwidth": + err = unpopulate(val, "MaxBandwidth", &v.MaxBandwidth) + delete(rawMsg, key) + case "maxPacketsPerSecond": + err = unpopulate(val, "MaxPacketsPerSecond", &v.MaxPacketsPerSecond) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) + delete(rawMsg, key) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) + delete(rawMsg, key) + case "vpnConnectionDuration": + err = unpopulate(val, "VPNConnectionDuration", &v.VPNConnectionDuration) + delete(rawMsg, key) + case "vpnConnectionId": + err = unpopulate(val, "VPNConnectionID", &v.VPNConnectionID) + delete(rawMsg, key) + case "vpnConnectionTime": + err = unpopulate(val, "VPNConnectionTime", &v.VPNConnectionTime) + delete(rawMsg, key) + case "vpnUserName": + err = unpopulate(val, "VPNUserName", &v.VPNUserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientConnectionHealthDetailListResult. +func (v VPNClientConnectionHealthDetailListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientConnectionHealthDetailListResult. +func (v *VPNClientConnectionHealthDetailListResult) 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 "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientIPsecParameters. +func (v VPNClientIPsecParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dhGroup", v.DhGroup) + populate(objectMap, "ipsecEncryption", v.IPSecEncryption) + populate(objectMap, "ipsecIntegrity", v.IPSecIntegrity) + populate(objectMap, "ikeEncryption", v.IkeEncryption) + populate(objectMap, "ikeIntegrity", v.IkeIntegrity) + populate(objectMap, "pfsGroup", v.PfsGroup) + populate(objectMap, "saDataSizeKilobytes", v.SaDataSizeKilobytes) + populate(objectMap, "saLifeTimeSeconds", v.SaLifeTimeSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientIPsecParameters. +func (v *VPNClientIPsecParameters) 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 "dhGroup": + err = unpopulate(val, "DhGroup", &v.DhGroup) + delete(rawMsg, key) + case "ipsecEncryption": + err = unpopulate(val, "IPSecEncryption", &v.IPSecEncryption) + delete(rawMsg, key) + case "ipsecIntegrity": + err = unpopulate(val, "IPSecIntegrity", &v.IPSecIntegrity) + delete(rawMsg, key) + case "ikeEncryption": + err = unpopulate(val, "IkeEncryption", &v.IkeEncryption) + delete(rawMsg, key) + case "ikeIntegrity": + err = unpopulate(val, "IkeIntegrity", &v.IkeIntegrity) + delete(rawMsg, key) + case "pfsGroup": + err = unpopulate(val, "PfsGroup", &v.PfsGroup) + delete(rawMsg, key) + case "saDataSizeKilobytes": + err = unpopulate(val, "SaDataSizeKilobytes", &v.SaDataSizeKilobytes) + delete(rawMsg, key) + case "saLifeTimeSeconds": + err = unpopulate(val, "SaLifeTimeSeconds", &v.SaLifeTimeSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientParameters. +func (v VPNClientParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationMethod", v.AuthenticationMethod) + populate(objectMap, "clientRootCertificates", v.ClientRootCertificates) + populate(objectMap, "processorArchitecture", v.ProcessorArchitecture) + populate(objectMap, "radiusServerAuthCertificate", v.RadiusServerAuthCertificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientParameters. +func (v *VPNClientParameters) 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 "authenticationMethod": + err = unpopulate(val, "AuthenticationMethod", &v.AuthenticationMethod) + delete(rawMsg, key) + case "clientRootCertificates": + err = unpopulate(val, "ClientRootCertificates", &v.ClientRootCertificates) + delete(rawMsg, key) + case "processorArchitecture": + err = unpopulate(val, "ProcessorArchitecture", &v.ProcessorArchitecture) + delete(rawMsg, key) + case "radiusServerAuthCertificate": + err = unpopulate(val, "RadiusServerAuthCertificate", &v.RadiusServerAuthCertificate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientRevokedCertificate. +func (v VPNClientRevokedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRevokedCertificate. +func (v *VPNClientRevokedCertificate) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientRevokedCertificatePropertiesFormat. +func (v VPNClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "thumbprint", v.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRevokedCertificatePropertiesFormat. +func (v *VPNClientRevokedCertificatePropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &v.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientRootCertificate. +func (v VPNClientRootCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRootCertificate. +func (v *VPNClientRootCertificate) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNClientRootCertificatePropertiesFormat. +func (v VPNClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "publicCertData", v.PublicCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNClientRootCertificatePropertiesFormat. +func (v *VPNClientRootCertificatePropertiesFormat) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "publicCertData": + err = unpopulate(val, "PublicCertData", &v.PublicCertData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNConnection. +func (v VPNConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnection. +func (v *VPNConnection) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNConnectionPacketCaptureStartParameters. +func (v VPNConnectionPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterData", v.FilterData) + populate(objectMap, "linkConnectionNames", v.LinkConnectionNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionPacketCaptureStartParameters. +func (v *VPNConnectionPacketCaptureStartParameters) 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 "filterData": + err = unpopulate(val, "FilterData", &v.FilterData) + delete(rawMsg, key) + case "linkConnectionNames": + err = unpopulate(val, "LinkConnectionNames", &v.LinkConnectionNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNConnectionPacketCaptureStopParameters. +func (v VPNConnectionPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkConnectionNames", v.LinkConnectionNames) + populate(objectMap, "sasUrl", v.SasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionPacketCaptureStopParameters. +func (v *VPNConnectionPacketCaptureStopParameters) 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 "linkConnectionNames": + err = unpopulate(val, "LinkConnectionNames", &v.LinkConnectionNames) + delete(rawMsg, key) + case "sasUrl": + err = unpopulate(val, "SasURL", &v.SasURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNConnectionProperties. +func (v VPNConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionBandwidth", v.ConnectionBandwidth) + populate(objectMap, "connectionStatus", v.ConnectionStatus) + populate(objectMap, "dpdTimeoutSeconds", v.DpdTimeoutSeconds) + populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) + populate(objectMap, "enableBgp", v.EnableBgp) + populate(objectMap, "enableInternetSecurity", v.EnableInternetSecurity) + populate(objectMap, "enableRateLimiting", v.EnableRateLimiting) + populate(objectMap, "ipsecPolicies", v.IPSecPolicies) + populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "remoteVpnSite", v.RemoteVPNSite) + populate(objectMap, "routingConfiguration", v.RoutingConfiguration) + populate(objectMap, "routingWeight", v.RoutingWeight) + populate(objectMap, "sharedKey", v.SharedKey) + populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) + populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) + populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) + populate(objectMap, "vpnConnectionProtocolType", v.VPNConnectionProtocolType) + populate(objectMap, "vpnLinkConnections", v.VPNLinkConnections) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionProperties. +func (v *VPNConnectionProperties) 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 "connectionBandwidth": + err = unpopulate(val, "ConnectionBandwidth", &v.ConnectionBandwidth) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) + delete(rawMsg, key) + case "dpdTimeoutSeconds": + err = unpopulate(val, "DpdTimeoutSeconds", &v.DpdTimeoutSeconds) + delete(rawMsg, key) + case "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) + delete(rawMsg, key) + case "enableBgp": + err = unpopulate(val, "EnableBgp", &v.EnableBgp) + delete(rawMsg, key) + case "enableInternetSecurity": + err = unpopulate(val, "EnableInternetSecurity", &v.EnableInternetSecurity) + delete(rawMsg, key) + case "enableRateLimiting": + err = unpopulate(val, "EnableRateLimiting", &v.EnableRateLimiting) + delete(rawMsg, key) + case "ipsecPolicies": + err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "remoteVpnSite": + err = unpopulate(val, "RemoteVPNSite", &v.RemoteVPNSite) + delete(rawMsg, key) + case "routingConfiguration": + err = unpopulate(val, "RoutingConfiguration", &v.RoutingConfiguration) + delete(rawMsg, key) + case "routingWeight": + err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &v.SharedKey) + delete(rawMsg, key) + case "trafficSelectorPolicies": + err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) + delete(rawMsg, key) + case "useLocalAzureIpAddress": + err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) + delete(rawMsg, key) + case "usePolicyBasedTrafficSelectors": + err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) + delete(rawMsg, key) + case "vpnConnectionProtocolType": + err = unpopulate(val, "VPNConnectionProtocolType", &v.VPNConnectionProtocolType) + delete(rawMsg, key) + case "vpnLinkConnections": + err = unpopulate(val, "VPNLinkConnections", &v.VPNLinkConnections) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNDeviceScriptParameters. +func (v VPNDeviceScriptParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deviceFamily", v.DeviceFamily) + populate(objectMap, "firmwareVersion", v.FirmwareVersion) + populate(objectMap, "vendor", v.Vendor) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNDeviceScriptParameters. +func (v *VPNDeviceScriptParameters) 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 "deviceFamily": + err = unpopulate(val, "DeviceFamily", &v.DeviceFamily) + delete(rawMsg, key) + case "firmwareVersion": + err = unpopulate(val, "FirmwareVersion", &v.FirmwareVersion) + delete(rawMsg, key) + case "vendor": + err = unpopulate(val, "Vendor", &v.Vendor) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGateway. +func (v VPNGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGateway. +func (v *VPNGateway) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayIPConfiguration. +func (v VPNGatewayIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "privateIpAddress", v.PrivateIPAddress) + populate(objectMap, "publicIpAddress", v.PublicIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayIPConfiguration. +func (v *VPNGatewayIPConfiguration) 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 "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) + delete(rawMsg, key) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayNatRule. +func (v VPNGatewayNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayNatRule. +func (v *VPNGatewayNatRule) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayNatRuleProperties. +func (v VPNGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egressVpnSiteLinkConnections", v.EgressVPNSiteLinkConnections) + populate(objectMap, "externalMappings", v.ExternalMappings) + populate(objectMap, "ipConfigurationId", v.IPConfigurationID) + populate(objectMap, "ingressVpnSiteLinkConnections", v.IngressVPNSiteLinkConnections) + populate(objectMap, "internalMappings", v.InternalMappings) + populate(objectMap, "mode", v.Mode) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayNatRuleProperties. +func (v *VPNGatewayNatRuleProperties) 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 "egressVpnSiteLinkConnections": + err = unpopulate(val, "EgressVPNSiteLinkConnections", &v.EgressVPNSiteLinkConnections) + delete(rawMsg, key) + case "externalMappings": + err = unpopulate(val, "ExternalMappings", &v.ExternalMappings) + delete(rawMsg, key) + case "ipConfigurationId": + err = unpopulate(val, "IPConfigurationID", &v.IPConfigurationID) + delete(rawMsg, key) + case "ingressVpnSiteLinkConnections": + err = unpopulate(val, "IngressVPNSiteLinkConnections", &v.IngressVPNSiteLinkConnections) + delete(rawMsg, key) + case "internalMappings": + err = unpopulate(val, "InternalMappings", &v.InternalMappings) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &v.Mode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayPacketCaptureStartParameters. +func (v VPNGatewayPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterData", v.FilterData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayPacketCaptureStartParameters. +func (v *VPNGatewayPacketCaptureStartParameters) 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 "filterData": + err = unpopulate(val, "FilterData", &v.FilterData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayPacketCaptureStopParameters. +func (v VPNGatewayPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUrl", v.SasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayPacketCaptureStopParameters. +func (v *VPNGatewayPacketCaptureStopParameters) 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 "sasUrl": + err = unpopulate(val, "SasURL", &v.SasURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNGatewayProperties. +func (v VPNGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpSettings", v.BgpSettings) + populate(objectMap, "connections", v.Connections) + populate(objectMap, "enableBgpRouteTranslationForNat", v.EnableBgpRouteTranslationForNat) + populate(objectMap, "ipConfigurations", v.IPConfigurations) + populate(objectMap, "isRoutingPreferenceInternet", v.IsRoutingPreferenceInternet) + populate(objectMap, "natRules", v.NatRules) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "vpnGatewayScaleUnit", v.VPNGatewayScaleUnit) + populate(objectMap, "virtualHub", v.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewayProperties. +func (v *VPNGatewayProperties) 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 "bgpSettings": + err = unpopulate(val, "BgpSettings", &v.BgpSettings) + delete(rawMsg, key) + case "connections": + err = unpopulate(val, "Connections", &v.Connections) + delete(rawMsg, key) + case "enableBgpRouteTranslationForNat": + err = unpopulate(val, "EnableBgpRouteTranslationForNat", &v.EnableBgpRouteTranslationForNat) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) + delete(rawMsg, key) + case "isRoutingPreferenceInternet": + err = unpopulate(val, "IsRoutingPreferenceInternet", &v.IsRoutingPreferenceInternet) + delete(rawMsg, key) + case "natRules": + err = unpopulate(val, "NatRules", &v.NatRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "vpnGatewayScaleUnit": + err = unpopulate(val, "VPNGatewayScaleUnit", &v.VPNGatewayScaleUnit) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &v.VirtualHub) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNLinkBgpSettings. +func (v VPNLinkBgpSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "asn", v.Asn) + populate(objectMap, "bgpPeeringAddress", v.BgpPeeringAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkBgpSettings. +func (v *VPNLinkBgpSettings) 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 "asn": + err = unpopulate(val, "Asn", &v.Asn) + delete(rawMsg, key) + case "bgpPeeringAddress": + err = unpopulate(val, "BgpPeeringAddress", &v.BgpPeeringAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNLinkProviderProperties. +func (v VPNLinkProviderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkProviderName", v.LinkProviderName) + populate(objectMap, "linkSpeedInMbps", v.LinkSpeedInMbps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkProviderProperties. +func (v *VPNLinkProviderProperties) 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 "linkProviderName": + err = unpopulate(val, "LinkProviderName", &v.LinkProviderName) + delete(rawMsg, key) + case "linkSpeedInMbps": + err = unpopulate(val, "LinkSpeedInMbps", &v.LinkSpeedInMbps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNNatRuleMapping. +func (v VPNNatRuleMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressSpace", v.AddressSpace) + populate(objectMap, "portRange", v.PortRange) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNNatRuleMapping. +func (v *VPNNatRuleMapping) 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 "addressSpace": + err = unpopulate(val, "AddressSpace", &v.AddressSpace) + delete(rawMsg, key) + case "portRange": + err = unpopulate(val, "PortRange", &v.PortRange) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNPacketCaptureStartParameters. +func (v VPNPacketCaptureStartParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filterData", v.FilterData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNPacketCaptureStartParameters. +func (v *VPNPacketCaptureStartParameters) 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 "filterData": + err = unpopulate(val, "FilterData", &v.FilterData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNPacketCaptureStopParameters. +func (v VPNPacketCaptureStopParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUrl", v.SasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNPacketCaptureStopParameters. +func (v *VPNPacketCaptureStopParameters) 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 "sasUrl": + err = unpopulate(val, "SasURL", &v.SasURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNProfileResponse. +func (v VPNProfileResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "profileUrl", v.ProfileURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNProfileResponse. +func (v *VPNProfileResponse) 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 "profileUrl": + err = unpopulate(val, "ProfileURL", &v.ProfileURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigRadiusClientRootCertificate. +func (v VPNServerConfigRadiusClientRootCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "thumbprint", v.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigRadiusClientRootCertificate. +func (v *VPNServerConfigRadiusClientRootCertificate) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &v.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigRadiusServerRootCertificate. +func (v VPNServerConfigRadiusServerRootCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "publicCertData", v.PublicCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigRadiusServerRootCertificate. +func (v *VPNServerConfigRadiusServerRootCertificate) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "publicCertData": + err = unpopulate(val, "PublicCertData", &v.PublicCertData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigVPNClientRevokedCertificate. +func (v VPNServerConfigVPNClientRevokedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "thumbprint", v.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigVPNClientRevokedCertificate. +func (v *VPNServerConfigVPNClientRevokedCertificate) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &v.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigVPNClientRootCertificate. +func (v VPNServerConfigVPNClientRootCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "publicCertData", v.PublicCertData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigVPNClientRootCertificate. +func (v *VPNServerConfigVPNClientRootCertificate) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "publicCertData": + err = unpopulate(val, "PublicCertData", &v.PublicCertData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfiguration. +func (v VPNServerConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfiguration. +func (v *VPNServerConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroup. +func (v VPNServerConfigurationPolicyGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroup. +func (v *VPNServerConfigurationPolicyGroup) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroupMember. +func (v VPNServerConfigurationPolicyGroupMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "attributeType", v.AttributeType) + populate(objectMap, "attributeValue", v.AttributeValue) + populate(objectMap, "name", v.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroupMember. +func (v *VPNServerConfigurationPolicyGroupMember) 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 "attributeType": + err = unpopulate(val, "AttributeType", &v.AttributeType) + delete(rawMsg, key) + case "attributeValue": + err = unpopulate(val, "AttributeValue", &v.AttributeValue) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationPolicyGroupProperties. +func (v VPNServerConfigurationPolicyGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isDefault", v.IsDefault) + populate(objectMap, "p2SConnectionConfigurations", v.P2SConnectionConfigurations) + populate(objectMap, "policyMembers", v.PolicyMembers) + populate(objectMap, "priority", v.Priority) + populate(objectMap, "provisioningState", v.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationPolicyGroupProperties. +func (v *VPNServerConfigurationPolicyGroupProperties) 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 "isDefault": + err = unpopulate(val, "IsDefault", &v.IsDefault) + delete(rawMsg, key) + case "p2SConnectionConfigurations": + err = unpopulate(val, "P2SConnectionConfigurations", &v.P2SConnectionConfigurations) + delete(rawMsg, key) + case "policyMembers": + err = unpopulate(val, "PolicyMembers", &v.PolicyMembers) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &v.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationProperties. +func (v VPNServerConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadAuthenticationParameters", v.AADAuthenticationParameters) + populate(objectMap, "configurationPolicyGroups", v.ConfigurationPolicyGroups) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "name", v.Name) + populate(objectMap, "p2SVpnGateways", v.P2SVPNGateways) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "radiusClientRootCertificates", v.RadiusClientRootCertificates) + populate(objectMap, "radiusServerAddress", v.RadiusServerAddress) + populate(objectMap, "radiusServerRootCertificates", v.RadiusServerRootCertificates) + populate(objectMap, "radiusServerSecret", v.RadiusServerSecret) + populate(objectMap, "radiusServers", v.RadiusServers) + populate(objectMap, "vpnAuthenticationTypes", v.VPNAuthenticationTypes) + populate(objectMap, "vpnClientIpsecPolicies", v.VPNClientIPSecPolicies) + populate(objectMap, "vpnClientRevokedCertificates", v.VPNClientRevokedCertificates) + populate(objectMap, "vpnClientRootCertificates", v.VPNClientRootCertificates) + populate(objectMap, "vpnProtocols", v.VPNProtocols) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationProperties. +func (v *VPNServerConfigurationProperties) 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 "aadAuthenticationParameters": + err = unpopulate(val, "AADAuthenticationParameters", &v.AADAuthenticationParameters) + delete(rawMsg, key) + case "configurationPolicyGroups": + err = unpopulate(val, "ConfigurationPolicyGroups", &v.ConfigurationPolicyGroups) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "p2SVpnGateways": + err = unpopulate(val, "P2SVPNGateways", &v.P2SVPNGateways) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "radiusClientRootCertificates": + err = unpopulate(val, "RadiusClientRootCertificates", &v.RadiusClientRootCertificates) + delete(rawMsg, key) + case "radiusServerAddress": + err = unpopulate(val, "RadiusServerAddress", &v.RadiusServerAddress) + delete(rawMsg, key) + case "radiusServerRootCertificates": + err = unpopulate(val, "RadiusServerRootCertificates", &v.RadiusServerRootCertificates) + delete(rawMsg, key) + case "radiusServerSecret": + err = unpopulate(val, "RadiusServerSecret", &v.RadiusServerSecret) + delete(rawMsg, key) + case "radiusServers": + err = unpopulate(val, "RadiusServers", &v.RadiusServers) + delete(rawMsg, key) + case "vpnAuthenticationTypes": + err = unpopulate(val, "VPNAuthenticationTypes", &v.VPNAuthenticationTypes) + delete(rawMsg, key) + case "vpnClientIpsecPolicies": + err = unpopulate(val, "VPNClientIPSecPolicies", &v.VPNClientIPSecPolicies) + delete(rawMsg, key) + case "vpnClientRevokedCertificates": + err = unpopulate(val, "VPNClientRevokedCertificates", &v.VPNClientRevokedCertificates) + delete(rawMsg, key) + case "vpnClientRootCertificates": + err = unpopulate(val, "VPNClientRootCertificates", &v.VPNClientRootCertificates) + delete(rawMsg, key) + case "vpnProtocols": + err = unpopulate(val, "VPNProtocols", &v.VPNProtocols) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNServerConfigurationsResponse. +func (v VPNServerConfigurationsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "vpnServerConfigurationResourceIds", v.VPNServerConfigurationResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNServerConfigurationsResponse. +func (v *VPNServerConfigurationsResponse) 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 "vpnServerConfigurationResourceIds": + err = unpopulate(val, "VPNServerConfigurationResourceIDs", &v.VPNServerConfigurationResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSite. +func (v VPNSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSite. +func (v *VPNSite) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteID. +func (v VPNSiteID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "vpnSite", v.VPNSite) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteID. +func (v *VPNSiteID) 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 "vpnSite": + err = unpopulate(val, "VPNSite", &v.VPNSite) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteLink. +func (v VPNSiteLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLink. +func (v *VPNSiteLink) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkConnection. +func (v VPNSiteLinkConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkConnection. +func (v *VPNSiteLinkConnection) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkConnectionProperties. +func (v VPNSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionBandwidth", v.ConnectionBandwidth) + populate(objectMap, "connectionStatus", v.ConnectionStatus) + populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) + populate(objectMap, "egressNatRules", v.EgressNatRules) + populate(objectMap, "enableBgp", v.EnableBgp) + populate(objectMap, "enableRateLimiting", v.EnableRateLimiting) + populate(objectMap, "ipsecPolicies", v.IPSecPolicies) + populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) + populate(objectMap, "ingressNatRules", v.IngressNatRules) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "routingWeight", v.RoutingWeight) + populate(objectMap, "sharedKey", v.SharedKey) + populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) + populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) + populate(objectMap, "vpnConnectionProtocolType", v.VPNConnectionProtocolType) + populate(objectMap, "vpnGatewayCustomBgpAddresses", v.VPNGatewayCustomBgpAddresses) + populate(objectMap, "vpnLinkConnectionMode", v.VPNLinkConnectionMode) + populate(objectMap, "vpnSiteLink", v.VPNSiteLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkConnectionProperties. +func (v *VPNSiteLinkConnectionProperties) 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 "connectionBandwidth": + err = unpopulate(val, "ConnectionBandwidth", &v.ConnectionBandwidth) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) + delete(rawMsg, key) + case "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) + delete(rawMsg, key) + case "egressNatRules": + err = unpopulate(val, "EgressNatRules", &v.EgressNatRules) + delete(rawMsg, key) + case "enableBgp": + err = unpopulate(val, "EnableBgp", &v.EnableBgp) + delete(rawMsg, key) + case "enableRateLimiting": + err = unpopulate(val, "EnableRateLimiting", &v.EnableRateLimiting) + delete(rawMsg, key) + case "ipsecPolicies": + err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) + delete(rawMsg, key) + case "ingressNatRules": + err = unpopulate(val, "IngressNatRules", &v.IngressNatRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "routingWeight": + err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &v.SharedKey) + delete(rawMsg, key) + case "useLocalAzureIpAddress": + err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) + delete(rawMsg, key) + case "usePolicyBasedTrafficSelectors": + err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) + delete(rawMsg, key) + case "vpnConnectionProtocolType": + err = unpopulate(val, "VPNConnectionProtocolType", &v.VPNConnectionProtocolType) + delete(rawMsg, key) + case "vpnGatewayCustomBgpAddresses": + err = unpopulate(val, "VPNGatewayCustomBgpAddresses", &v.VPNGatewayCustomBgpAddresses) + delete(rawMsg, key) + case "vpnLinkConnectionMode": + err = unpopulate(val, "VPNLinkConnectionMode", &v.VPNLinkConnectionMode) + delete(rawMsg, key) + case "vpnSiteLink": + err = unpopulate(val, "VPNSiteLink", &v.VPNSiteLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteLinkProperties. +func (v VPNSiteLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpProperties", v.BgpProperties) + populate(objectMap, "fqdn", v.Fqdn) + populate(objectMap, "ipAddress", v.IPAddress) + populate(objectMap, "linkProperties", v.LinkProperties) + populate(objectMap, "provisioningState", v.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteLinkProperties. +func (v *VPNSiteLinkProperties) 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 "bgpProperties": + err = unpopulate(val, "BgpProperties", &v.BgpProperties) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &v.Fqdn) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &v.IPAddress) + delete(rawMsg, key) + case "linkProperties": + err = unpopulate(val, "LinkProperties", &v.LinkProperties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNSiteProperties. +func (v VPNSiteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressSpace", v.AddressSpace) + populate(objectMap, "bgpProperties", v.BgpProperties) + populate(objectMap, "deviceProperties", v.DeviceProperties) + populate(objectMap, "ipAddress", v.IPAddress) + populate(objectMap, "isSecuritySite", v.IsSecuritySite) + populate(objectMap, "o365Policy", v.O365Policy) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "siteKey", v.SiteKey) + populate(objectMap, "vpnSiteLinks", v.VPNSiteLinks) + populate(objectMap, "virtualWan", v.VirtualWan) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNSiteProperties. +func (v *VPNSiteProperties) 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 "addressSpace": + err = unpopulate(val, "AddressSpace", &v.AddressSpace) + delete(rawMsg, key) + case "bgpProperties": + err = unpopulate(val, "BgpProperties", &v.BgpProperties) + delete(rawMsg, key) + case "deviceProperties": + err = unpopulate(val, "DeviceProperties", &v.DeviceProperties) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &v.IPAddress) + delete(rawMsg, key) + case "isSecuritySite": + err = unpopulate(val, "IsSecuritySite", &v.IsSecuritySite) + delete(rawMsg, key) + case "o365Policy": + err = unpopulate(val, "O365Policy", &v.O365Policy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "siteKey": + err = unpopulate(val, "SiteKey", &v.SiteKey) + delete(rawMsg, key) + case "vpnSiteLinks": + err = unpopulate(val, "VPNSiteLinks", &v.VPNSiteLinks) + delete(rawMsg, key) + case "virtualWan": + err = unpopulate(val, "VirtualWan", &v.VirtualWan) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationIPFlowParameters. +func (v VerificationIPFlowParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "direction", v.Direction) + populate(objectMap, "localIPAddress", v.LocalIPAddress) + populate(objectMap, "localPort", v.LocalPort) + populate(objectMap, "protocol", v.Protocol) + populate(objectMap, "remoteIPAddress", v.RemoteIPAddress) + populate(objectMap, "remotePort", v.RemotePort) + populate(objectMap, "targetNicResourceId", v.TargetNicResourceID) + populate(objectMap, "targetResourceId", v.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationIPFlowParameters. +func (v *VerificationIPFlowParameters) 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 "direction": + err = unpopulate(val, "Direction", &v.Direction) + delete(rawMsg, key) + case "localIPAddress": + err = unpopulate(val, "LocalIPAddress", &v.LocalIPAddress) + delete(rawMsg, key) + case "localPort": + err = unpopulate(val, "LocalPort", &v.LocalPort) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &v.Protocol) + delete(rawMsg, key) + case "remoteIPAddress": + err = unpopulate(val, "RemoteIPAddress", &v.RemoteIPAddress) + delete(rawMsg, key) + case "remotePort": + err = unpopulate(val, "RemotePort", &v.RemotePort) + delete(rawMsg, key) + case "targetNicResourceId": + err = unpopulate(val, "TargetNicResourceID", &v.TargetNicResourceID) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &v.TargetResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationIPFlowResult. +func (v VerificationIPFlowResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "access", v.Access) + populate(objectMap, "ruleName", v.RuleName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationIPFlowResult. +func (v *VerificationIPFlowResult) 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 "access": + err = unpopulate(val, "Access", &v.Access) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &v.RuleName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualAppliance. +func (v VirtualAppliance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "identity", v.Identity) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualAppliance. +func (v *VirtualAppliance) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &v.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceListResult. +func (v VirtualApplianceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceListResult. +func (v *VirtualApplianceListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceNicProperties. +func (v VirtualApplianceNicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "privateIpAddress", v.PrivateIPAddress) + populate(objectMap, "publicIpAddress", v.PublicIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceNicProperties. +func (v *VirtualApplianceNicProperties) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) + delete(rawMsg, key) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualAppliancePropertiesFormat. +func (v VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", v.AddressPrefix) + populate(objectMap, "bootStrapConfigurationBlobs", v.BootStrapConfigurationBlobs) + populate(objectMap, "cloudInitConfiguration", v.CloudInitConfiguration) + populate(objectMap, "cloudInitConfigurationBlobs", v.CloudInitConfigurationBlobs) + populate(objectMap, "delegation", v.Delegation) + populate(objectMap, "deploymentType", v.DeploymentType) + populate(objectMap, "inboundSecurityRules", v.InboundSecurityRules) + populate(objectMap, "nvaSku", v.NvaSKU) + populate(objectMap, "partnerManagedResource", v.PartnerManagedResource) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "sshPublicKey", v.SSHPublicKey) + populate(objectMap, "virtualApplianceAsn", v.VirtualApplianceAsn) + populate(objectMap, "virtualApplianceNics", v.VirtualApplianceNics) + populate(objectMap, "virtualApplianceSites", v.VirtualApplianceSites) + populate(objectMap, "virtualHub", v.VirtualHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualAppliancePropertiesFormat. +func (v *VirtualAppliancePropertiesFormat) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) + delete(rawMsg, key) + case "bootStrapConfigurationBlobs": + err = unpopulate(val, "BootStrapConfigurationBlobs", &v.BootStrapConfigurationBlobs) + delete(rawMsg, key) + case "cloudInitConfiguration": + err = unpopulate(val, "CloudInitConfiguration", &v.CloudInitConfiguration) + delete(rawMsg, key) + case "cloudInitConfigurationBlobs": + err = unpopulate(val, "CloudInitConfigurationBlobs", &v.CloudInitConfigurationBlobs) + delete(rawMsg, key) + case "delegation": + err = unpopulate(val, "Delegation", &v.Delegation) + delete(rawMsg, key) + case "deploymentType": + err = unpopulate(val, "DeploymentType", &v.DeploymentType) + delete(rawMsg, key) + case "inboundSecurityRules": + err = unpopulate(val, "InboundSecurityRules", &v.InboundSecurityRules) + delete(rawMsg, key) + case "nvaSku": + err = unpopulate(val, "NvaSKU", &v.NvaSKU) + delete(rawMsg, key) + case "partnerManagedResource": + err = unpopulate(val, "PartnerManagedResource", &v.PartnerManagedResource) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "sshPublicKey": + err = unpopulate(val, "SSHPublicKey", &v.SSHPublicKey) + delete(rawMsg, key) + case "virtualApplianceAsn": + err = unpopulate(val, "VirtualApplianceAsn", &v.VirtualApplianceAsn) + delete(rawMsg, key) + case "virtualApplianceNics": + err = unpopulate(val, "VirtualApplianceNics", &v.VirtualApplianceNics) + delete(rawMsg, key) + case "virtualApplianceSites": + err = unpopulate(val, "VirtualApplianceSites", &v.VirtualApplianceSites) + delete(rawMsg, key) + case "virtualHub": + err = unpopulate(val, "VirtualHub", &v.VirtualHub) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKU. +func (v VirtualApplianceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKU. +func (v *VirtualApplianceSKU) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUInstances. +func (v VirtualApplianceSKUInstances) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceCount", v.InstanceCount) + populate(objectMap, "scaleUnit", v.ScaleUnit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUInstances. +func (v *VirtualApplianceSKUInstances) 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 "instanceCount": + err = unpopulate(val, "InstanceCount", &v.InstanceCount) + delete(rawMsg, key) + case "scaleUnit": + err = unpopulate(val, "ScaleUnit", &v.ScaleUnit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUListResult. +func (v VirtualApplianceSKUListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUListResult. +func (v *VirtualApplianceSKUListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUProperties. +func (v VirtualApplianceSKUProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bundledScaleUnit", v.BundledScaleUnit) + populate(objectMap, "marketPlaceVersion", v.MarketPlaceVersion) + populate(objectMap, "vendor", v.Vendor) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUProperties. +func (v *VirtualApplianceSKUProperties) 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 "bundledScaleUnit": + err = unpopulate(val, "BundledScaleUnit", &v.BundledScaleUnit) + delete(rawMsg, key) + case "marketPlaceVersion": + err = unpopulate(val, "MarketPlaceVersion", &v.MarketPlaceVersion) + delete(rawMsg, key) + case "vendor": + err = unpopulate(val, "Vendor", &v.Vendor) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSKUPropertiesFormat. +func (v VirtualApplianceSKUPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availableScaleUnits", v.AvailableScaleUnits) + populate(objectMap, "availableVersions", v.AvailableVersions) + populate(objectMap, "vendor", v.Vendor) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSKUPropertiesFormat. +func (v *VirtualApplianceSKUPropertiesFormat) 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 "availableScaleUnits": + err = unpopulate(val, "AvailableScaleUnits", &v.AvailableScaleUnits) + delete(rawMsg, key) + case "availableVersions": + err = unpopulate(val, "AvailableVersions", &v.AvailableVersions) + delete(rawMsg, key) + case "vendor": + err = unpopulate(val, "Vendor", &v.Vendor) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSite. +func (v VirtualApplianceSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSite. +func (v *VirtualApplianceSite) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSiteListResult. +func (v VirtualApplianceSiteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSiteListResult. +func (v *VirtualApplianceSiteListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceSiteProperties. +func (v VirtualApplianceSiteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", v.AddressPrefix) + populate(objectMap, "o365Policy", v.O365Policy) + populate(objectMap, "provisioningState", v.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceSiteProperties. +func (v *VirtualApplianceSiteProperties) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) + delete(rawMsg, key) + case "o365Policy": + err = unpopulate(val, "O365Policy", &v.O365Policy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHub. +func (v VirtualHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "kind", v.Kind) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHub. +func (v *VirtualHub) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &v.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubEffectiveRoute. +func (v VirtualHubEffectiveRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", v.AddressPrefixes) + populate(objectMap, "asPath", v.AsPath) + populate(objectMap, "nextHopType", v.NextHopType) + populate(objectMap, "nextHops", v.NextHops) + populate(objectMap, "routeOrigin", v.RouteOrigin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubEffectiveRoute. +func (v *VirtualHubEffectiveRoute) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &v.AddressPrefixes) + delete(rawMsg, key) + case "asPath": + err = unpopulate(val, "AsPath", &v.AsPath) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &v.NextHopType) + delete(rawMsg, key) + case "nextHops": + err = unpopulate(val, "NextHops", &v.NextHops) + delete(rawMsg, key) + case "routeOrigin": + err = unpopulate(val, "RouteOrigin", &v.RouteOrigin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubEffectiveRouteList. +func (v VirtualHubEffectiveRouteList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubEffectiveRouteList. +func (v *VirtualHubEffectiveRouteList) 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 "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubID. +func (v VirtualHubID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubID. +func (v *VirtualHubID) 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 "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubProperties. +func (v VirtualHubProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", v.AddressPrefix) + populate(objectMap, "allowBranchToBranchTraffic", v.AllowBranchToBranchTraffic) + populate(objectMap, "azureFirewall", v.AzureFirewall) + populate(objectMap, "bgpConnections", v.BgpConnections) + populate(objectMap, "expressRouteGateway", v.ExpressRouteGateway) + populate(objectMap, "hubRoutingPreference", v.HubRoutingPreference) + populate(objectMap, "ipConfigurations", v.IPConfigurations) + populate(objectMap, "p2SVpnGateway", v.P2SVPNGateway) + populate(objectMap, "preferredRoutingGateway", v.PreferredRoutingGateway) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "routeMaps", v.RouteMaps) + populate(objectMap, "routeTable", v.RouteTable) + populate(objectMap, "routingState", v.RoutingState) + populate(objectMap, "sku", v.SKU) + populate(objectMap, "securityPartnerProvider", v.SecurityPartnerProvider) + populate(objectMap, "securityProviderName", v.SecurityProviderName) + populate(objectMap, "vpnGateway", v.VPNGateway) + populate(objectMap, "virtualHubRouteTableV2s", v.VirtualHubRouteTableV2S) + populate(objectMap, "virtualRouterAsn", v.VirtualRouterAsn) + populate(objectMap, "virtualRouterAutoScaleConfiguration", v.VirtualRouterAutoScaleConfiguration) + populate(objectMap, "virtualRouterIps", v.VirtualRouterIPs) + populate(objectMap, "virtualWan", v.VirtualWan) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubProperties. +func (v *VirtualHubProperties) 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 "addressPrefix": + err = unpopulate(val, "AddressPrefix", &v.AddressPrefix) + delete(rawMsg, key) + case "allowBranchToBranchTraffic": + err = unpopulate(val, "AllowBranchToBranchTraffic", &v.AllowBranchToBranchTraffic) + delete(rawMsg, key) + case "azureFirewall": + err = unpopulate(val, "AzureFirewall", &v.AzureFirewall) + delete(rawMsg, key) + case "bgpConnections": + err = unpopulate(val, "BgpConnections", &v.BgpConnections) + delete(rawMsg, key) + case "expressRouteGateway": + err = unpopulate(val, "ExpressRouteGateway", &v.ExpressRouteGateway) + delete(rawMsg, key) + case "hubRoutingPreference": + err = unpopulate(val, "HubRoutingPreference", &v.HubRoutingPreference) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) + delete(rawMsg, key) + case "p2SVpnGateway": + err = unpopulate(val, "P2SVPNGateway", &v.P2SVPNGateway) + delete(rawMsg, key) + case "preferredRoutingGateway": + err = unpopulate(val, "PreferredRoutingGateway", &v.PreferredRoutingGateway) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "routeMaps": + err = unpopulate(val, "RouteMaps", &v.RouteMaps) + delete(rawMsg, key) + case "routeTable": + err = unpopulate(val, "RouteTable", &v.RouteTable) + delete(rawMsg, key) + case "routingState": + err = unpopulate(val, "RoutingState", &v.RoutingState) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &v.SKU) + delete(rawMsg, key) + case "securityPartnerProvider": + err = unpopulate(val, "SecurityPartnerProvider", &v.SecurityPartnerProvider) + delete(rawMsg, key) + case "securityProviderName": + err = unpopulate(val, "SecurityProviderName", &v.SecurityProviderName) + delete(rawMsg, key) + case "vpnGateway": + err = unpopulate(val, "VPNGateway", &v.VPNGateway) + delete(rawMsg, key) + case "virtualHubRouteTableV2s": + err = unpopulate(val, "VirtualHubRouteTableV2S", &v.VirtualHubRouteTableV2S) + delete(rawMsg, key) + case "virtualRouterAsn": + err = unpopulate(val, "VirtualRouterAsn", &v.VirtualRouterAsn) + delete(rawMsg, key) + case "virtualRouterAutoScaleConfiguration": + err = unpopulate(val, "VirtualRouterAutoScaleConfiguration", &v.VirtualRouterAutoScaleConfiguration) + delete(rawMsg, key) + case "virtualRouterIps": + err = unpopulate(val, "VirtualRouterIPs", &v.VirtualRouterIPs) + delete(rawMsg, key) + case "virtualWan": + err = unpopulate(val, "VirtualWan", &v.VirtualWan) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubRoute. +func (v VirtualHubRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", v.AddressPrefixes) + populate(objectMap, "nextHopIpAddress", v.NextHopIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRoute. +func (v *VirtualHubRoute) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &v.AddressPrefixes) + delete(rawMsg, key) + case "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &v.NextHopIPAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTable. +func (v VirtualHubRouteTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "routes", v.Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTable. +func (v *VirtualHubRouteTable) 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 "routes": + err = unpopulate(val, "Routes", &v.Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTableV2. +func (v VirtualHubRouteTableV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTableV2. +func (v *VirtualHubRouteTableV2) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteTableV2Properties. +func (v VirtualHubRouteTableV2Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "attachedConnections", v.AttachedConnections) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "routes", v.Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteTableV2Properties. +func (v *VirtualHubRouteTableV2Properties) 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 "attachedConnections": + err = unpopulate(val, "AttachedConnections", &v.AttachedConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &v.Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualHubRouteV2. +func (v VirtualHubRouteV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationType", v.DestinationType) + populate(objectMap, "destinations", v.Destinations) + populate(objectMap, "nextHopType", v.NextHopType) + populate(objectMap, "nextHops", v.NextHops) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubRouteV2. +func (v *VirtualHubRouteV2) 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 "destinationType": + err = unpopulate(val, "DestinationType", &v.DestinationType) + delete(rawMsg, key) + case "destinations": + err = unpopulate(val, "Destinations", &v.Destinations) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &v.NextHopType) + delete(rawMsg, key) + case "nextHops": + err = unpopulate(val, "NextHops", &v.NextHops) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetwork. +func (v VirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "extendedLocation", v.ExtendedLocation) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetwork. +func (v *VirtualNetwork) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkBgpCommunities. +func (v VirtualNetworkBgpCommunities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "regionalCommunity", v.RegionalCommunity) + populate(objectMap, "virtualNetworkCommunity", v.VirtualNetworkCommunity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkBgpCommunities. +func (v *VirtualNetworkBgpCommunities) 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 "regionalCommunity": + err = unpopulate(val, "RegionalCommunity", &v.RegionalCommunity) + delete(rawMsg, key) + case "virtualNetworkCommunity": + err = unpopulate(val, "VirtualNetworkCommunity", &v.VirtualNetworkCommunity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConnectionGatewayReference. +func (v VirtualNetworkConnectionGatewayReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConnectionGatewayReference. +func (v *VirtualNetworkConnectionGatewayReference) 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 "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkDdosProtectionStatusResult. +func (v VirtualNetworkDdosProtectionStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkDdosProtectionStatusResult. +func (v *VirtualNetworkDdosProtectionStatusResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkEncryption. +func (v VirtualNetworkEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", v.Enabled) + populate(objectMap, "enforcement", v.Enforcement) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkEncryption. +func (v *VirtualNetworkEncryption) 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 "enabled": + err = unpopulate(val, "Enabled", &v.Enabled) + delete(rawMsg, key) + case "enforcement": + err = unpopulate(val, "Enforcement", &v.Enforcement) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGateway. +func (v VirtualNetworkGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "extendedLocation", v.ExtendedLocation) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGateway. +func (v *VirtualNetworkGateway) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnection. +func (v VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnection. +func (v *VirtualNetworkGatewayConnection) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListEntity. +func (v VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListEntity. +func (v *VirtualNetworkGatewayConnectionListEntity) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListEntityPropertiesFormat. +func (v VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationKey", v.AuthorizationKey) + populate(objectMap, "connectionMode", v.ConnectionMode) + populate(objectMap, "connectionProtocol", v.ConnectionProtocol) + populate(objectMap, "connectionStatus", v.ConnectionStatus) + populate(objectMap, "connectionType", v.ConnectionType) + populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) + populate(objectMap, "enableBgp", v.EnableBgp) + populate(objectMap, "enablePrivateLinkFastPath", v.EnablePrivateLinkFastPath) + populate(objectMap, "expressRouteGatewayBypass", v.ExpressRouteGatewayBypass) + populate(objectMap, "gatewayCustomBgpIpAddresses", v.GatewayCustomBgpIPAddresses) + populate(objectMap, "ipsecPolicies", v.IPSecPolicies) + populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) + populate(objectMap, "localNetworkGateway2", v.LocalNetworkGateway2) + populate(objectMap, "peer", v.Peer) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "routingWeight", v.RoutingWeight) + populate(objectMap, "sharedKey", v.SharedKey) + populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) + populate(objectMap, "tunnelConnectionStatus", v.TunnelConnectionStatus) + populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) + populate(objectMap, "virtualNetworkGateway1", v.VirtualNetworkGateway1) + populate(objectMap, "virtualNetworkGateway2", v.VirtualNetworkGateway2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListEntityPropertiesFormat. +func (v *VirtualNetworkGatewayConnectionListEntityPropertiesFormat) 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 "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &v.AuthorizationKey) + delete(rawMsg, key) + case "connectionMode": + err = unpopulate(val, "ConnectionMode", &v.ConnectionMode) + delete(rawMsg, key) + case "connectionProtocol": + err = unpopulate(val, "ConnectionProtocol", &v.ConnectionProtocol) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) + delete(rawMsg, key) + case "connectionType": + err = unpopulate(val, "ConnectionType", &v.ConnectionType) + delete(rawMsg, key) + case "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) + delete(rawMsg, key) + case "enableBgp": + err = unpopulate(val, "EnableBgp", &v.EnableBgp) + delete(rawMsg, key) + case "enablePrivateLinkFastPath": + err = unpopulate(val, "EnablePrivateLinkFastPath", &v.EnablePrivateLinkFastPath) + delete(rawMsg, key) + case "expressRouteGatewayBypass": + err = unpopulate(val, "ExpressRouteGatewayBypass", &v.ExpressRouteGatewayBypass) + delete(rawMsg, key) + case "gatewayCustomBgpIpAddresses": + err = unpopulate(val, "GatewayCustomBgpIPAddresses", &v.GatewayCustomBgpIPAddresses) + delete(rawMsg, key) + case "ipsecPolicies": + err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) + delete(rawMsg, key) + case "localNetworkGateway2": + err = unpopulate(val, "LocalNetworkGateway2", &v.LocalNetworkGateway2) + delete(rawMsg, key) + case "peer": + err = unpopulate(val, "Peer", &v.Peer) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + case "routingWeight": + err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &v.SharedKey) + delete(rawMsg, key) + case "trafficSelectorPolicies": + err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) + delete(rawMsg, key) + case "tunnelConnectionStatus": + err = unpopulate(val, "TunnelConnectionStatus", &v.TunnelConnectionStatus) + delete(rawMsg, key) + case "usePolicyBasedTrafficSelectors": + err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) + delete(rawMsg, key) + case "virtualNetworkGateway1": + err = unpopulate(val, "VirtualNetworkGateway1", &v.VirtualNetworkGateway1) + delete(rawMsg, key) + case "virtualNetworkGateway2": + err = unpopulate(val, "VirtualNetworkGateway2", &v.VirtualNetworkGateway2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionListResult. +func (v VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionListResult. +func (v *VirtualNetworkGatewayConnectionListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayConnectionPropertiesFormat. +func (v VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationKey", v.AuthorizationKey) + populate(objectMap, "connectionMode", v.ConnectionMode) + populate(objectMap, "connectionProtocol", v.ConnectionProtocol) + populate(objectMap, "connectionStatus", v.ConnectionStatus) + populate(objectMap, "connectionType", v.ConnectionType) + populate(objectMap, "dpdTimeoutSeconds", v.DpdTimeoutSeconds) + populate(objectMap, "egressBytesTransferred", v.EgressBytesTransferred) + populate(objectMap, "egressNatRules", v.EgressNatRules) + populate(objectMap, "enableBgp", v.EnableBgp) + populate(objectMap, "enablePrivateLinkFastPath", v.EnablePrivateLinkFastPath) + populate(objectMap, "expressRouteGatewayBypass", v.ExpressRouteGatewayBypass) + populate(objectMap, "gatewayCustomBgpIpAddresses", v.GatewayCustomBgpIPAddresses) + populate(objectMap, "ipsecPolicies", v.IPSecPolicies) + populate(objectMap, "ingressBytesTransferred", v.IngressBytesTransferred) + populate(objectMap, "ingressNatRules", v.IngressNatRules) + populate(objectMap, "localNetworkGateway2", v.LocalNetworkGateway2) + populate(objectMap, "peer", v.Peer) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "routingWeight", v.RoutingWeight) + populate(objectMap, "sharedKey", v.SharedKey) + populate(objectMap, "trafficSelectorPolicies", v.TrafficSelectorPolicies) + populate(objectMap, "tunnelConnectionStatus", v.TunnelConnectionStatus) + populate(objectMap, "useLocalAzureIpAddress", v.UseLocalAzureIPAddress) + populate(objectMap, "usePolicyBasedTrafficSelectors", v.UsePolicyBasedTrafficSelectors) + populate(objectMap, "virtualNetworkGateway1", v.VirtualNetworkGateway1) + populate(objectMap, "virtualNetworkGateway2", v.VirtualNetworkGateway2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionPropertiesFormat. +func (v *VirtualNetworkGatewayConnectionPropertiesFormat) 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 "authorizationKey": + err = unpopulate(val, "AuthorizationKey", &v.AuthorizationKey) + delete(rawMsg, key) + case "connectionMode": + err = unpopulate(val, "ConnectionMode", &v.ConnectionMode) + delete(rawMsg, key) + case "connectionProtocol": + err = unpopulate(val, "ConnectionProtocol", &v.ConnectionProtocol) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &v.ConnectionStatus) + delete(rawMsg, key) + case "connectionType": + err = unpopulate(val, "ConnectionType", &v.ConnectionType) + delete(rawMsg, key) + case "dpdTimeoutSeconds": + err = unpopulate(val, "DpdTimeoutSeconds", &v.DpdTimeoutSeconds) + delete(rawMsg, key) + case "egressBytesTransferred": + err = unpopulate(val, "EgressBytesTransferred", &v.EgressBytesTransferred) + delete(rawMsg, key) + case "egressNatRules": + err = unpopulate(val, "EgressNatRules", &v.EgressNatRules) + delete(rawMsg, key) + case "enableBgp": + err = unpopulate(val, "EnableBgp", &v.EnableBgp) + delete(rawMsg, key) + case "enablePrivateLinkFastPath": + err = unpopulate(val, "EnablePrivateLinkFastPath", &v.EnablePrivateLinkFastPath) + delete(rawMsg, key) + case "expressRouteGatewayBypass": + err = unpopulate(val, "ExpressRouteGatewayBypass", &v.ExpressRouteGatewayBypass) + delete(rawMsg, key) + case "gatewayCustomBgpIpAddresses": + err = unpopulate(val, "GatewayCustomBgpIPAddresses", &v.GatewayCustomBgpIPAddresses) + delete(rawMsg, key) + case "ipsecPolicies": + err = unpopulate(val, "IPSecPolicies", &v.IPSecPolicies) + delete(rawMsg, key) + case "ingressBytesTransferred": + err = unpopulate(val, "IngressBytesTransferred", &v.IngressBytesTransferred) + delete(rawMsg, key) + case "ingressNatRules": + err = unpopulate(val, "IngressNatRules", &v.IngressNatRules) + delete(rawMsg, key) + case "localNetworkGateway2": + err = unpopulate(val, "LocalNetworkGateway2", &v.LocalNetworkGateway2) + delete(rawMsg, key) + case "peer": + err = unpopulate(val, "Peer", &v.Peer) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + case "routingWeight": + err = unpopulate(val, "RoutingWeight", &v.RoutingWeight) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &v.SharedKey) + delete(rawMsg, key) + case "trafficSelectorPolicies": + err = unpopulate(val, "TrafficSelectorPolicies", &v.TrafficSelectorPolicies) + delete(rawMsg, key) + case "tunnelConnectionStatus": + err = unpopulate(val, "TunnelConnectionStatus", &v.TunnelConnectionStatus) + delete(rawMsg, key) + case "useLocalAzureIpAddress": + err = unpopulate(val, "UseLocalAzureIPAddress", &v.UseLocalAzureIPAddress) + delete(rawMsg, key) + case "usePolicyBasedTrafficSelectors": + err = unpopulate(val, "UsePolicyBasedTrafficSelectors", &v.UsePolicyBasedTrafficSelectors) + delete(rawMsg, key) + case "virtualNetworkGateway1": + err = unpopulate(val, "VirtualNetworkGateway1", &v.VirtualNetworkGateway1) + delete(rawMsg, key) + case "virtualNetworkGateway2": + err = unpopulate(val, "VirtualNetworkGateway2", &v.VirtualNetworkGateway2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayIPConfiguration. +func (v VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayIPConfiguration. +func (v *VirtualNetworkGatewayIPConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayIPConfigurationPropertiesFormat. +func (v VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateIPAddress", v.PrivateIPAddress) + populate(objectMap, "privateIPAllocationMethod", v.PrivateIPAllocationMethod) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "publicIPAddress", v.PublicIPAddress) + populate(objectMap, "subnet", v.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayIPConfigurationPropertiesFormat. +func (v *VirtualNetworkGatewayIPConfigurationPropertiesFormat) 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 "privateIPAddress": + err = unpopulate(val, "PrivateIPAddress", &v.PrivateIPAddress) + delete(rawMsg, key) + case "privateIPAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &v.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "publicIPAddress": + err = unpopulate(val, "PublicIPAddress", &v.PublicIPAddress) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &v.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayListConnectionsResult. +func (v VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayListConnectionsResult. +func (v *VirtualNetworkGatewayListConnectionsResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayListResult. +func (v VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayListResult. +func (v *VirtualNetworkGatewayListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayNatRule. +func (v VirtualNetworkGatewayNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayNatRule. +func (v *VirtualNetworkGatewayNatRule) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayNatRuleProperties. +func (v VirtualNetworkGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "externalMappings", v.ExternalMappings) + populate(objectMap, "ipConfigurationId", v.IPConfigurationID) + populate(objectMap, "internalMappings", v.InternalMappings) + populate(objectMap, "mode", v.Mode) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayNatRuleProperties. +func (v *VirtualNetworkGatewayNatRuleProperties) 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 "externalMappings": + err = unpopulate(val, "ExternalMappings", &v.ExternalMappings) + delete(rawMsg, key) + case "ipConfigurationId": + err = unpopulate(val, "IPConfigurationID", &v.IPConfigurationID) + delete(rawMsg, key) + case "internalMappings": + err = unpopulate(val, "InternalMappings", &v.InternalMappings) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &v.Mode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayPolicyGroup. +func (v VirtualNetworkGatewayPolicyGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayPolicyGroup. +func (v *VirtualNetworkGatewayPolicyGroup) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayPolicyGroupMember. +func (v VirtualNetworkGatewayPolicyGroupMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "attributeType", v.AttributeType) + populate(objectMap, "attributeValue", v.AttributeValue) + populate(objectMap, "name", v.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayPolicyGroupMember. +func (v *VirtualNetworkGatewayPolicyGroupMember) 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 "attributeType": + err = unpopulate(val, "AttributeType", &v.AttributeType) + delete(rawMsg, key) + case "attributeValue": + err = unpopulate(val, "AttributeValue", &v.AttributeValue) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayPolicyGroupProperties. +func (v VirtualNetworkGatewayPolicyGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isDefault", v.IsDefault) + populate(objectMap, "policyMembers", v.PolicyMembers) + populate(objectMap, "priority", v.Priority) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "vngClientConnectionConfigurations", v.VngClientConnectionConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayPolicyGroupProperties. +func (v *VirtualNetworkGatewayPolicyGroupProperties) 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 "isDefault": + err = unpopulate(val, "IsDefault", &v.IsDefault) + delete(rawMsg, key) + case "policyMembers": + err = unpopulate(val, "PolicyMembers", &v.PolicyMembers) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &v.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "vngClientConnectionConfigurations": + err = unpopulate(val, "VngClientConnectionConfigurations", &v.VngClientConnectionConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayPropertiesFormat. +func (v VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeActive", v.Active) + populate(objectMap, "allowRemoteVnetTraffic", v.AllowRemoteVnetTraffic) + populate(objectMap, "allowVirtualWanTraffic", v.AllowVirtualWanTraffic) + populate(objectMap, "bgpSettings", v.BgpSettings) + populate(objectMap, "customRoutes", v.CustomRoutes) + populate(objectMap, "disableIPSecReplayProtection", v.DisableIPSecReplayProtection) + populate(objectMap, "enableBgp", v.EnableBgp) + populate(objectMap, "enableBgpRouteTranslationForNat", v.EnableBgpRouteTranslationForNat) + populate(objectMap, "enableDnsForwarding", v.EnableDNSForwarding) + populate(objectMap, "enablePrivateIpAddress", v.EnablePrivateIPAddress) + populate(objectMap, "gatewayDefaultSite", v.GatewayDefaultSite) + populate(objectMap, "gatewayType", v.GatewayType) + populate(objectMap, "ipConfigurations", v.IPConfigurations) + populate(objectMap, "inboundDnsForwardingEndpoint", v.InboundDNSForwardingEndpoint) + populate(objectMap, "natRules", v.NatRules) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "sku", v.SKU) + populate(objectMap, "vNetExtendedLocationResourceId", v.VNetExtendedLocationResourceID) + populate(objectMap, "vpnClientConfiguration", v.VPNClientConfiguration) + populate(objectMap, "vpnGatewayGeneration", v.VPNGatewayGeneration) + populate(objectMap, "vpnType", v.VPNType) + populate(objectMap, "virtualNetworkGatewayPolicyGroups", v.VirtualNetworkGatewayPolicyGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayPropertiesFormat. +func (v *VirtualNetworkGatewayPropertiesFormat) 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 "activeActive": + err = unpopulate(val, "Active", &v.Active) + delete(rawMsg, key) + case "allowRemoteVnetTraffic": + err = unpopulate(val, "AllowRemoteVnetTraffic", &v.AllowRemoteVnetTraffic) + delete(rawMsg, key) + case "allowVirtualWanTraffic": + err = unpopulate(val, "AllowVirtualWanTraffic", &v.AllowVirtualWanTraffic) + delete(rawMsg, key) + case "bgpSettings": + err = unpopulate(val, "BgpSettings", &v.BgpSettings) + delete(rawMsg, key) + case "customRoutes": + err = unpopulate(val, "CustomRoutes", &v.CustomRoutes) + delete(rawMsg, key) + case "disableIPSecReplayProtection": + err = unpopulate(val, "DisableIPSecReplayProtection", &v.DisableIPSecReplayProtection) + delete(rawMsg, key) + case "enableBgp": + err = unpopulate(val, "EnableBgp", &v.EnableBgp) + delete(rawMsg, key) + case "enableBgpRouteTranslationForNat": + err = unpopulate(val, "EnableBgpRouteTranslationForNat", &v.EnableBgpRouteTranslationForNat) + delete(rawMsg, key) + case "enableDnsForwarding": + err = unpopulate(val, "EnableDNSForwarding", &v.EnableDNSForwarding) + delete(rawMsg, key) + case "enablePrivateIpAddress": + err = unpopulate(val, "EnablePrivateIPAddress", &v.EnablePrivateIPAddress) + delete(rawMsg, key) + case "gatewayDefaultSite": + err = unpopulate(val, "GatewayDefaultSite", &v.GatewayDefaultSite) + delete(rawMsg, key) + case "gatewayType": + err = unpopulate(val, "GatewayType", &v.GatewayType) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) + delete(rawMsg, key) + case "inboundDnsForwardingEndpoint": + err = unpopulate(val, "InboundDNSForwardingEndpoint", &v.InboundDNSForwardingEndpoint) + delete(rawMsg, key) + case "natRules": + err = unpopulate(val, "NatRules", &v.NatRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &v.SKU) + delete(rawMsg, key) + case "vNetExtendedLocationResourceId": + err = unpopulate(val, "VNetExtendedLocationResourceID", &v.VNetExtendedLocationResourceID) + delete(rawMsg, key) + case "vpnClientConfiguration": + err = unpopulate(val, "VPNClientConfiguration", &v.VPNClientConfiguration) + delete(rawMsg, key) + case "vpnGatewayGeneration": + err = unpopulate(val, "VPNGatewayGeneration", &v.VPNGatewayGeneration) + delete(rawMsg, key) + case "vpnType": + err = unpopulate(val, "VPNType", &v.VPNType) + delete(rawMsg, key) + case "virtualNetworkGatewayPolicyGroups": + err = unpopulate(val, "VirtualNetworkGatewayPolicyGroups", &v.VirtualNetworkGatewayPolicyGroups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewaySKU. +func (v VirtualNetworkGatewaySKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", v.Capacity) + populate(objectMap, "name", v.Name) + populate(objectMap, "tier", v.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaySKU. +func (v *VirtualNetworkGatewaySKU) 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 "capacity": + err = unpopulate(val, "Capacity", &v.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &v.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkListResult. +func (v VirtualNetworkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkListResult. +func (v *VirtualNetworkListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkListUsageResult. +func (v VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkListUsageResult. +func (v *VirtualNetworkListUsageResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeering. +func (v VirtualNetworkPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeering. +func (v *VirtualNetworkPeering) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeeringListResult. +func (v VirtualNetworkPeeringListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeeringListResult. +func (v *VirtualNetworkPeeringListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPeeringPropertiesFormat. +func (v VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowForwardedTraffic", v.AllowForwardedTraffic) + populate(objectMap, "allowGatewayTransit", v.AllowGatewayTransit) + populate(objectMap, "allowVirtualNetworkAccess", v.AllowVirtualNetworkAccess) + populate(objectMap, "doNotVerifyRemoteGateways", v.DoNotVerifyRemoteGateways) + populate(objectMap, "peeringState", v.PeeringState) + populate(objectMap, "peeringSyncLevel", v.PeeringSyncLevel) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "remoteAddressSpace", v.RemoteAddressSpace) + populate(objectMap, "remoteBgpCommunities", v.RemoteBgpCommunities) + populate(objectMap, "remoteVirtualNetwork", v.RemoteVirtualNetwork) + populate(objectMap, "remoteVirtualNetworkAddressSpace", v.RemoteVirtualNetworkAddressSpace) + populate(objectMap, "remoteVirtualNetworkEncryption", v.RemoteVirtualNetworkEncryption) + populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "useRemoteGateways", v.UseRemoteGateways) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPeeringPropertiesFormat. +func (v *VirtualNetworkPeeringPropertiesFormat) 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 "allowForwardedTraffic": + err = unpopulate(val, "AllowForwardedTraffic", &v.AllowForwardedTraffic) + delete(rawMsg, key) + case "allowGatewayTransit": + err = unpopulate(val, "AllowGatewayTransit", &v.AllowGatewayTransit) + delete(rawMsg, key) + case "allowVirtualNetworkAccess": + err = unpopulate(val, "AllowVirtualNetworkAccess", &v.AllowVirtualNetworkAccess) + delete(rawMsg, key) + case "doNotVerifyRemoteGateways": + err = unpopulate(val, "DoNotVerifyRemoteGateways", &v.DoNotVerifyRemoteGateways) + delete(rawMsg, key) + case "peeringState": + err = unpopulate(val, "PeeringState", &v.PeeringState) + delete(rawMsg, key) + case "peeringSyncLevel": + err = unpopulate(val, "PeeringSyncLevel", &v.PeeringSyncLevel) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "remoteAddressSpace": + err = unpopulate(val, "RemoteAddressSpace", &v.RemoteAddressSpace) + delete(rawMsg, key) + case "remoteBgpCommunities": + err = unpopulate(val, "RemoteBgpCommunities", &v.RemoteBgpCommunities) + delete(rawMsg, key) + case "remoteVirtualNetwork": + err = unpopulate(val, "RemoteVirtualNetwork", &v.RemoteVirtualNetwork) + delete(rawMsg, key) + case "remoteVirtualNetworkAddressSpace": + err = unpopulate(val, "RemoteVirtualNetworkAddressSpace", &v.RemoteVirtualNetworkAddressSpace) + delete(rawMsg, key) + case "remoteVirtualNetworkEncryption": + err = unpopulate(val, "RemoteVirtualNetworkEncryption", &v.RemoteVirtualNetworkEncryption) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + case "useRemoteGateways": + err = unpopulate(val, "UseRemoteGateways", &v.UseRemoteGateways) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkPropertiesFormat. +func (v VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressSpace", v.AddressSpace) + populate(objectMap, "bgpCommunities", v.BgpCommunities) + populate(objectMap, "ddosProtectionPlan", v.DdosProtectionPlan) + populate(objectMap, "dhcpOptions", v.DhcpOptions) + populate(objectMap, "enableDdosProtection", v.EnableDdosProtection) + populate(objectMap, "enableVmProtection", v.EnableVMProtection) + populate(objectMap, "encryption", v.Encryption) + populate(objectMap, "flowLogs", v.FlowLogs) + populate(objectMap, "flowTimeoutInMinutes", v.FlowTimeoutInMinutes) + populate(objectMap, "ipAllocations", v.IPAllocations) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceGuid", v.ResourceGUID) + populate(objectMap, "subnets", v.Subnets) + populate(objectMap, "virtualNetworkPeerings", v.VirtualNetworkPeerings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkPropertiesFormat. +func (v *VirtualNetworkPropertiesFormat) 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 "addressSpace": + err = unpopulate(val, "AddressSpace", &v.AddressSpace) + delete(rawMsg, key) + case "bgpCommunities": + err = unpopulate(val, "BgpCommunities", &v.BgpCommunities) + delete(rawMsg, key) + case "ddosProtectionPlan": + err = unpopulate(val, "DdosProtectionPlan", &v.DdosProtectionPlan) + delete(rawMsg, key) + case "dhcpOptions": + err = unpopulate(val, "DhcpOptions", &v.DhcpOptions) + delete(rawMsg, key) + case "enableDdosProtection": + err = unpopulate(val, "EnableDdosProtection", &v.EnableDdosProtection) + delete(rawMsg, key) + case "enableVmProtection": + err = unpopulate(val, "EnableVMProtection", &v.EnableVMProtection) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &v.Encryption) + delete(rawMsg, key) + case "flowLogs": + err = unpopulate(val, "FlowLogs", &v.FlowLogs) + delete(rawMsg, key) + case "flowTimeoutInMinutes": + err = unpopulate(val, "FlowTimeoutInMinutes", &v.FlowTimeoutInMinutes) + delete(rawMsg, key) + case "ipAllocations": + err = unpopulate(val, "IPAllocations", &v.IPAllocations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &v.Subnets) + delete(rawMsg, key) + case "virtualNetworkPeerings": + err = unpopulate(val, "VirtualNetworkPeerings", &v.VirtualNetworkPeerings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTap. +func (v VirtualNetworkTap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTap. +func (v *VirtualNetworkTap) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTapListResult. +func (v VirtualNetworkTapListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTapListResult. +func (v *VirtualNetworkTapListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkTapPropertiesFormat. +func (v VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationLoadBalancerFrontEndIPConfiguration", v.DestinationLoadBalancerFrontEndIPConfiguration) + populate(objectMap, "destinationNetworkInterfaceIPConfiguration", v.DestinationNetworkInterfaceIPConfiguration) + populate(objectMap, "destinationPort", v.DestinationPort) + populate(objectMap, "networkInterfaceTapConfigurations", v.NetworkInterfaceTapConfigurations) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "resourceGuid", v.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkTapPropertiesFormat. +func (v *VirtualNetworkTapPropertiesFormat) 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 "destinationLoadBalancerFrontEndIPConfiguration": + err = unpopulate(val, "DestinationLoadBalancerFrontEndIPConfiguration", &v.DestinationLoadBalancerFrontEndIPConfiguration) + delete(rawMsg, key) + case "destinationNetworkInterfaceIPConfiguration": + err = unpopulate(val, "DestinationNetworkInterfaceIPConfiguration", &v.DestinationNetworkInterfaceIPConfiguration) + delete(rawMsg, key) + case "destinationPort": + err = unpopulate(val, "DestinationPort", &v.DestinationPort) + delete(rawMsg, key) + case "networkInterfaceTapConfigurations": + err = unpopulate(val, "NetworkInterfaceTapConfigurations", &v.NetworkInterfaceTapConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &v.ResourceGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkUsage. +func (v VirtualNetworkUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", v.CurrentValue) + populate(objectMap, "id", v.ID) + populate(objectMap, "limit", v.Limit) + populate(objectMap, "name", v.Name) + populate(objectMap, "unit", v.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkUsage. +func (v *VirtualNetworkUsage) 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 "currentValue": + err = unpopulate(val, "CurrentValue", &v.CurrentValue) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &v.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &v.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkUsageName. +func (v VirtualNetworkUsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", v.LocalizedValue) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkUsageName. +func (v *VirtualNetworkUsageName) 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 "localizedValue": + err = unpopulate(val, "LocalizedValue", &v.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouter. +func (v VirtualRouter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouter. +func (v *VirtualRouter) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterAutoScaleConfiguration. +func (v VirtualRouterAutoScaleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "minCapacity", v.MinCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterAutoScaleConfiguration. +func (v *VirtualRouterAutoScaleConfiguration) 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 "minCapacity": + err = unpopulate(val, "MinCapacity", &v.MinCapacity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterListResult. +func (v VirtualRouterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterListResult. +func (v *VirtualRouterListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeering. +func (v VirtualRouterPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeering. +func (v *VirtualRouterPeering) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeeringListResult. +func (v VirtualRouterPeeringListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeeringListResult. +func (v *VirtualRouterPeeringListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPeeringProperties. +func (v VirtualRouterPeeringProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "peerAsn", v.PeerAsn) + populate(objectMap, "peerIp", v.PeerIP) + populate(objectMap, "provisioningState", v.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPeeringProperties. +func (v *VirtualRouterPeeringProperties) 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 "peerAsn": + err = unpopulate(val, "PeerAsn", &v.PeerAsn) + delete(rawMsg, key) + case "peerIp": + err = unpopulate(val, "PeerIP", &v.PeerIP) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualRouterPropertiesFormat. +func (v VirtualRouterPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostedGateway", v.HostedGateway) + populate(objectMap, "hostedSubnet", v.HostedSubnet) + populate(objectMap, "peerings", v.Peerings) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "virtualRouterAsn", v.VirtualRouterAsn) + populate(objectMap, "virtualRouterIps", v.VirtualRouterIPs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualRouterPropertiesFormat. +func (v *VirtualRouterPropertiesFormat) 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 "hostedGateway": + err = unpopulate(val, "HostedGateway", &v.HostedGateway) + delete(rawMsg, key) + case "hostedSubnet": + err = unpopulate(val, "HostedSubnet", &v.HostedSubnet) + delete(rawMsg, key) + case "peerings": + err = unpopulate(val, "Peerings", &v.Peerings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "virtualRouterAsn": + err = unpopulate(val, "VirtualRouterAsn", &v.VirtualRouterAsn) + delete(rawMsg, key) + case "virtualRouterIps": + err = unpopulate(val, "VirtualRouterIPs", &v.VirtualRouterIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualWAN. +func (v VirtualWAN) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWAN. +func (v *VirtualWAN) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualWanProperties. +func (v VirtualWanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowBranchToBranchTraffic", v.AllowBranchToBranchTraffic) + populate(objectMap, "allowVnetToVnetTraffic", v.AllowVnetToVnetTraffic) + populate(objectMap, "disableVpnEncryption", v.DisableVPNEncryption) + populate(objectMap, "office365LocalBreakoutCategory", v.Office365LocalBreakoutCategory) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "type", v.Type) + populate(objectMap, "vpnSites", v.VPNSites) + populate(objectMap, "virtualHubs", v.VirtualHubs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanProperties. +func (v *VirtualWanProperties) 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 "allowBranchToBranchTraffic": + err = unpopulate(val, "AllowBranchToBranchTraffic", &v.AllowBranchToBranchTraffic) + delete(rawMsg, key) + case "allowVnetToVnetTraffic": + err = unpopulate(val, "AllowVnetToVnetTraffic", &v.AllowVnetToVnetTraffic) + delete(rawMsg, key) + case "disableVpnEncryption": + err = unpopulate(val, "DisableVPNEncryption", &v.DisableVPNEncryption) + delete(rawMsg, key) + case "office365LocalBreakoutCategory": + err = unpopulate(val, "Office365LocalBreakoutCategory", &v.Office365LocalBreakoutCategory) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + case "vpnSites": + err = unpopulate(val, "VPNSites", &v.VPNSites) + delete(rawMsg, key) + case "virtualHubs": + err = unpopulate(val, "VirtualHubs", &v.VirtualHubs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualWanSecurityProvider. +func (v VirtualWanSecurityProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "type", v.Type) + populate(objectMap, "url", v.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanSecurityProvider. +func (v *VirtualWanSecurityProvider) 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 "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &v.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualWanSecurityProviders. +func (v VirtualWanSecurityProviders) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "supportedProviders", v.SupportedProviders) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanSecurityProviders. +func (v *VirtualWanSecurityProviders) 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 "supportedProviders": + err = unpopulate(val, "SupportedProviders", &v.SupportedProviders) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualWanVPNProfileParameters. +func (v VirtualWanVPNProfileParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authenticationMethod", v.AuthenticationMethod) + populate(objectMap, "vpnServerConfigurationResourceId", v.VPNServerConfigurationResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualWanVPNProfileParameters. +func (v *VirtualWanVPNProfileParameters) 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 "authenticationMethod": + err = unpopulate(val, "AuthenticationMethod", &v.AuthenticationMethod) + delete(rawMsg, key) + case "vpnServerConfigurationResourceId": + err = unpopulate(val, "VPNServerConfigurationResourceID", &v.VPNServerConfigurationResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VnetRoute. +func (v VnetRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpConnections", v.BgpConnections) + populate(objectMap, "staticRoutes", v.StaticRoutes) + populate(objectMap, "staticRoutesConfig", v.StaticRoutesConfig) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VnetRoute. +func (v *VnetRoute) 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 "bgpConnections": + err = unpopulate(val, "BgpConnections", &v.BgpConnections) + delete(rawMsg, key) + case "staticRoutes": + err = unpopulate(val, "StaticRoutes", &v.StaticRoutes) + delete(rawMsg, key) + case "staticRoutesConfig": + err = unpopulate(val, "StaticRoutesConfig", &v.StaticRoutesConfig) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VngClientConnectionConfiguration. +func (v VngClientConnectionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VngClientConnectionConfiguration. +func (v *VngClientConnectionConfiguration) 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 "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VngClientConnectionConfigurationProperties. +func (v VngClientConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "vpnClientAddressPool", v.VPNClientAddressPool) + populate(objectMap, "virtualNetworkGatewayPolicyGroups", v.VirtualNetworkGatewayPolicyGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VngClientConnectionConfigurationProperties. +func (v *VngClientConnectionConfigurationProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "vpnClientAddressPool": + err = unpopulate(val, "VPNClientAddressPool", &v.VPNClientAddressPool) + delete(rawMsg, key) + case "virtualNetworkGatewayPolicyGroups": + err = unpopulate(val, "VirtualNetworkGatewayPolicyGroups", &v.VirtualNetworkGatewayPolicyGroups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Watcher. +func (w Watcher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Watcher. +func (w *Watcher) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WatcherListResult. +func (w WatcherListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherListResult. +func (w *WatcherListResult) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WatcherPropertiesFormat. +func (w WatcherPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", w.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WatcherPropertiesFormat. +func (w *WatcherPropertiesFormat) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallCustomRule. +func (w WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", w.Action) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "matchConditions", w.MatchConditions) + populate(objectMap, "name", w.Name) + populate(objectMap, "priority", w.Priority) + populate(objectMap, "ruleType", w.RuleType) + populate(objectMap, "state", w.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallCustomRule. +func (w *WebApplicationFirewallCustomRule) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &w.Action) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "matchConditions": + err = unpopulate(val, "MatchConditions", &w.MatchConditions) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &w.Priority) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &w.RuleType) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &w.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicy. +func (w WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicy. +func (w *WebApplicationFirewallPolicy) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyListResult. +func (w WebApplicationFirewallPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyListResult. +func (w *WebApplicationFirewallPolicyListResult) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyPropertiesFormat. +func (w WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationGateways", w.ApplicationGateways) + populate(objectMap, "customRules", w.CustomRules) + populate(objectMap, "httpListeners", w.HTTPListeners) + populate(objectMap, "managedRules", w.ManagedRules) + populate(objectMap, "pathBasedRules", w.PathBasedRules) + populate(objectMap, "policySettings", w.PolicySettings) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "resourceState", w.ResourceState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyPropertiesFormat. +func (w *WebApplicationFirewallPolicyPropertiesFormat) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationGateways": + err = unpopulate(val, "ApplicationGateways", &w.ApplicationGateways) + delete(rawMsg, key) + case "customRules": + err = unpopulate(val, "CustomRules", &w.CustomRules) + delete(rawMsg, key) + case "httpListeners": + err = unpopulate(val, "HTTPListeners", &w.HTTPListeners) + delete(rawMsg, key) + case "managedRules": + err = unpopulate(val, "ManagedRules", &w.ManagedRules) + delete(rawMsg, key) + case "pathBasedRules": + err = unpopulate(val, "PathBasedRules", &w.PathBasedRules) + delete(rawMsg, key) + case "policySettings": + err = unpopulate(val, "PolicySettings", &w.PolicySettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &w.ResourceState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, 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 { + 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/network/armnetwork/v2/natgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/natgateways_client.go new file mode 100644 index 00000000000..a62b572ea3a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/natgateways_client.go @@ -0,0 +1,421 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// NatGatewaysClient contains the methods for the NatGateways group. +// Don't use this type directly, use NewNatGatewaysClient() instead. +type NatGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNatGatewaysClient creates a new instance of NatGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNatGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".NatGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NatGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a nat gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - natGatewayName - The name of the nat gateway. +// - parameters - Parameters supplied to the create or update nat gateway operation. +// - options - NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate +// method. +func (client *NatGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[NatGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, natGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NatGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a nat gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *NatGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, natGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if natGatewayName == "" { + return nil, errors.New("parameter natGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified nat gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - natGatewayName - The name of the nat gateway. +// - options - NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. +func (client *NatGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*runtime.Poller[NatGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, natGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NatGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified nat gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, natGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if natGatewayName == "" { + return nil, errors.New("parameter natGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified nat gateway in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - natGatewayName - The name of the nat gateway. +// - options - NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. +func (client *NatGatewaysClient) Get(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (NatGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, natGatewayName, options) + if err != nil { + return NatGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if natGatewayName == "" { + return nil, errors.New("parameter natGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGatewaysClientGetResponse, error) { + result := NatGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NatGateway); err != nil { + return NatGatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all nat gateways in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.NewListPager method. +func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options *NatGatewaysClientListOptions) *runtime.Pager[NatGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListResponse]{ + More: func(page NatGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NatGatewaysClientListResponse) (NatGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NatGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *NatGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGatewaysClientListResponse, error) { + result := NatGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NatGatewayListResult); err != nil { + return NatGatewaysClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the Nat Gateways in a subscription. +// +// Generated from API version 2022-09-01 +// - options - NatGatewaysClientListAllOptions contains the optional parameters for the NatGatewaysClient.NewListAllPager method. +func (client *NatGatewaysClient) NewListAllPager(options *NatGatewaysClientListAllOptions) *runtime.Pager[NatGatewaysClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[NatGatewaysClientListAllResponse]{ + More: func(page NatGatewaysClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NatGatewaysClientListAllResponse) (NatGatewaysClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NatGatewaysClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatGatewaysClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatGatewaysClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, options *NatGatewaysClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *NatGatewaysClient) listAllHandleResponse(resp *http.Response) (NatGatewaysClientListAllResponse, error) { + result := NatGatewaysClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NatGatewayListResult); err != nil { + return NatGatewaysClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates nat gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - natGatewayName - The name of the nat gateway. +// - parameters - Parameters supplied to update nat gateway tags. +// - options - NatGatewaysClientUpdateTagsOptions contains the optional parameters for the NatGatewaysClient.UpdateTags method. +func (client *NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject, options *NatGatewaysClientUpdateTagsOptions) (NatGatewaysClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, natGatewayName, parameters, options) + if err != nil { + return NatGatewaysClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatGatewaysClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatGatewaysClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject, options *NatGatewaysClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if natGatewayName == "" { + return nil, errors.New("parameter natGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natGatewayName}", url.PathEscape(natGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *NatGatewaysClient) updateTagsHandleResponse(resp *http.Response) (NatGatewaysClientUpdateTagsResponse, error) { + result := NatGatewaysClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NatGateway); err != nil { + return NatGatewaysClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/natrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/natrules_client.go new file mode 100644 index 00000000000..f4d06a2ef69 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/natrules_client.go @@ -0,0 +1,322 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// NatRulesClient contains the methods for the NatRules group. +// Don't use this type directly, use NewNatRulesClient() instead. +type NatRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNatRulesClient creates a new instance of NatRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NatRulesClient, error) { + cl, err := arm.NewClient(moduleName+".NatRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NatRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - natRuleParameters - Parameters supplied to create or Update a Nat Rule. +// - options - NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate +// method. +func (client *NatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NatRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *NatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, natRuleParameters) +} + +// BeginDelete - Deletes a nat rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - options - NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. +func (client *NatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*runtime.Poller[NatRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, natRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NatRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NatRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a nat rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *NatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a nat ruleGet. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - options - NatRulesClientGetOptions contains the optional parameters for the NatRulesClient.Get method. +func (client *NatRulesClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (NatRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, natRuleName, options) + if err != nil { + return NatRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NatRulesClient) getHandleResponse(resp *http.Response) (NatRulesClientGetResponse, error) { + result := NatRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNGatewayNatRule); err != nil { + return NatRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByVPNGatewayPager - Retrieves all nat rules for a particular virtual wan vpn gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.NewListByVPNGatewayPager +// method. +func (client *NatRulesClient) NewListByVPNGatewayPager(resourceGroupName string, gatewayName string, options *NatRulesClientListByVPNGatewayOptions) *runtime.Pager[NatRulesClientListByVPNGatewayResponse] { + return runtime.NewPager(runtime.PagingHandler[NatRulesClientListByVPNGatewayResponse]{ + More: func(page NatRulesClientListByVPNGatewayResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NatRulesClientListByVPNGatewayResponse) (NatRulesClientListByVPNGatewayResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVPNGatewayCreateRequest(ctx, resourceGroupName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NatRulesClientListByVPNGatewayResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NatRulesClientListByVPNGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NatRulesClientListByVPNGatewayResponse{}, runtime.NewResponseError(resp) + } + return client.listByVPNGatewayHandleResponse(resp) + }, + }) +} + +// listByVPNGatewayCreateRequest creates the ListByVPNGateway request. +func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *NatRulesClientListByVPNGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVPNGatewayHandleResponse handles the ListByVPNGateway response. +func (client *NatRulesClient) listByVPNGatewayHandleResponse(resp *http.Response) (NatRulesClientListByVPNGatewayResponse, error) { + result := NatRulesClientListByVPNGatewayResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewayNatRulesResult); err != nil { + return NatRulesClientListByVPNGatewayResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/operations_client.go new file mode 100644 index 00000000000..8a122570e42 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/operations_client.go @@ -0,0 +1,94 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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+".OperationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - Lists all of the available Network Rest API operations. +// +// Generated from API version 2022-09-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 page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + 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) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Network/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", "2022-09-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/network/armnetwork/v2/p2svpngateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/p2svpngateways_client.go new file mode 100644 index 00000000000..6ecd0934016 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/p2svpngateways_client.go @@ -0,0 +1,774 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// P2SVPNGatewaysClient contains the methods for the P2SVPNGateways group. +// Don't use this type directly, use NewP2SVPNGatewaysClient() instead. +type P2SVPNGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewP2SVPNGatewaysClient creates a new instance of P2SVPNGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewP2SVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*P2SVPNGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".P2SVPNGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &P2SVPNGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - gatewayName - The name of the gateway. +// - p2SVPNGatewayParameters - Parameters supplied to create or Update a virtual wan p2s vpn gateway. +// - options - P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate +// method. +func (client *P2SVPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[P2SVPNGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, p2SVPNGatewayParameters) +} + +// BeginDelete - Deletes a virtual wan p2s vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - gatewayName - The name of the gateway. +// - options - P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete +// method. +func (client *P2SVPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*runtime.Poller[P2SVPNGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a virtual wan p2s vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - p2SVPNGatewayName - The name of the P2S Vpn Gateway. +// - request - The parameters are supplied to disconnect p2s vpn connections. +// - options - P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections +// method. +func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*runtime.Poller[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disconnectP2SVPNConnections(ctx, resourceGroupName, p2SVPNGatewayName, request, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DisconnectP2SVPNConnections - Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnections(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*http.Response, error) { + req, err := client.disconnectP2SVPNConnectionsCreateRequest(ctx, resourceGroupName, p2SVPNGatewayName, request, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disconnectP2SVPNConnectionsCreateRequest creates the DisconnectP2SVPNConnections request. +func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections" + 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 p2SVPNGatewayName == "" { + return nil, errors.New("parameter p2SVPNGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{p2sVpnGatewayName}", url.PathEscape(p2SVPNGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} + +// BeginGenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the P2SVpnGateway. +// - parameters - Parameters supplied to the generate P2SVpnGateway VPN client package operation. +// - options - P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile +// method. +func (client *P2SVPNGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*runtime.Poller[P2SVPNGatewaysClientGenerateVPNProfileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.generateVPNProfile(ctx, resourceGroupName, gatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGenerateVPNProfileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGenerateVPNProfileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GenerateVPNProfile - Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { + req, err := client.generateVPNProfileCreateRequest(ctx, resourceGroupName, gatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// generateVPNProfileCreateRequest creates the GenerateVPNProfile request. +func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVPNProfileParameters, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Retrieves the details of a virtual wan p2s vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - gatewayName - The name of the gateway. +// - options - P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. +func (client *P2SVPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (P2SVPNGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return P2SVPNGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return P2SVPNGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return P2SVPNGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *P2SVPNGatewaysClient) getHandleResponse(resp *http.Response) (P2SVPNGatewaysClientGetResponse, error) { + result := P2SVPNGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.P2SVPNGateway); err != nil { + return P2SVPNGatewaysClientGetResponse{}, err + } + return result, nil +} + +// BeginGetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the P2SVpnGateway. +// - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth +// method. +func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*runtime.Poller[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getP2SVPNConnectionHealth(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetP2SVPNConnectionHealth - Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { + req, err := client.getP2SVPNConnectionHealthCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getP2SVPNConnectionHealthCreateRequest creates the GetP2SVPNConnectionHealth request. +func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual +// wan P2SVpnGateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the P2SVpnGateway. +// - request - Request parameters supplied to get p2s vpn connections detailed health. +// - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed +// method. +func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*runtime.Poller[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getP2SVPNConnectionHealthDetailed(ctx, resourceGroupName, gatewayName, request, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetP2SVPNConnectionHealthDetailed - Gets the sas url to get the connection health detail of P2S clients of the virtual +// wan P2SVpnGateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*http.Response, error) { + req, err := client.getP2SVPNConnectionHealthDetailedCreateRequest(ctx, resourceGroupName, gatewayName, request, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getP2SVPNConnectionHealthDetailedCreateRequest creates the GetP2SVPNConnectionHealthDetailed request. +func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} + +// NewListPager - Lists all the P2SVpnGateways in a subscription. +// +// Generated from API version 2022-09-01 +// - options - P2SVPNGatewaysClientListOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListPager method. +func (client *P2SVPNGatewaysClient) NewListPager(options *P2SVPNGatewaysClientListOptions) *runtime.Pager[P2SVPNGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListResponse]{ + More: func(page P2SVPNGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *P2SVPNGatewaysClientListResponse) (P2SVPNGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return P2SVPNGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return P2SVPNGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return P2SVPNGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, options *P2SVPNGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2SVPNGatewaysClientListResponse, error) { + result := P2SVPNGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListP2SVPNGatewaysResult); err != nil { + return P2SVPNGatewaysClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager +// method. +func (client *P2SVPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[P2SVPNGatewaysClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[P2SVPNGatewaysClientListByResourceGroupResponse]{ + More: func(page P2SVPNGatewaysClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *P2SVPNGatewaysClientListByResourceGroupResponse) (P2SVPNGatewaysClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return P2SVPNGatewaysClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return P2SVPNGatewaysClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return P2SVPNGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *P2SVPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (P2SVPNGatewaysClientListByResourceGroupResponse, error) { + result := P2SVPNGatewaysClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListP2SVPNGatewaysResult); err != nil { + return P2SVPNGatewaysClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// BeginReset - Resets the primary of the p2s vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - gatewayName - The name of the gateway. +// - options - P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset +// method. +func (client *P2SVPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*runtime.Poller[P2SVPNGatewaysClientResetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reset(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientResetResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientResetResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Reset - Resets the primary of the p2s vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { + req, err := client.resetCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetCreateRequest creates the Reset request. +func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdateTags - Updates virtual wan p2s vpn gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the P2SVpnGateway. +// - gatewayName - The name of the gateway. +// - p2SVPNGatewayParameters - Parameters supplied to update a virtual wan p2s vpn gateway tags. +// - options - P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags +// method. +func (client *P2SVPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[P2SVPNGatewaysClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[P2SVPNGatewaysClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[P2SVPNGatewaysClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates virtual wan p2s vpn gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *P2SVPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, gatewayName, p2SVPNGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, p2SVPNGatewayParameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/packetcaptures_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/packetcaptures_client.go new file mode 100644 index 00000000000..fdaf0ebf598 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/packetcaptures_client.go @@ -0,0 +1,460 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PacketCapturesClient contains the methods for the PacketCaptures group. +// Don't use this type directly, use NewPacketCapturesClient() instead. +type PacketCapturesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPacketCapturesClient creates a new instance of PacketCapturesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPacketCapturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PacketCapturesClient, error) { + cl, err := arm.NewClient(moduleName+".PacketCapturesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PacketCapturesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create and start a packet capture on the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - packetCaptureName - The name of the packet capture session. +// - parameters - Parameters that define the create packet capture operation. +// - options - PacketCapturesClientBeginCreateOptions contains the optional parameters for the PacketCapturesClient.BeginCreate +// method. +func (client *PacketCapturesClient) BeginCreate(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*runtime.Poller[PacketCapturesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PacketCapturesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Create and start a packet capture on the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PacketCapturesClient) create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, options *PacketCapturesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if packetCaptureName == "" { + return nil, errors.New("parameter packetCaptureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - packetCaptureName - The name of the packet capture session. +// - options - PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete +// method. +func (client *PacketCapturesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*runtime.Poller[PacketCapturesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PacketCapturesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PacketCapturesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if packetCaptureName == "" { + return nil, errors.New("parameter packetCaptureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a packet capture session by name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - packetCaptureName - The name of the packet capture session. +// - options - PacketCapturesClientGetOptions contains the optional parameters for the PacketCapturesClient.Get method. +func (client *PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientGetOptions) (PacketCapturesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return PacketCapturesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PacketCapturesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PacketCapturesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if packetCaptureName == "" { + return nil, errors.New("parameter packetCaptureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PacketCapturesClient) getHandleResponse(resp *http.Response) (PacketCapturesClientGetResponse, error) { + result := PacketCapturesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PacketCaptureResult); err != nil { + return PacketCapturesClientGetResponse{}, err + } + return result, nil +} + +// BeginGetStatus - Query the status of a running packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the Network Watcher resource. +// - packetCaptureName - The name given to the packet capture session. +// - options - PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus +// method. +func (client *PacketCapturesClient) BeginGetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*runtime.Poller[PacketCapturesClientGetStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getStatus(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientGetStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PacketCapturesClientGetStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetStatus - Query the status of a running packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PacketCapturesClient) getStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*http.Response, error) { + req, err := client.getStatusCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getStatusCreateRequest creates the GetStatus request. +func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginGetStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if packetCaptureName == "" { + return nil, errors.New("parameter packetCaptureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListPager - Lists all packet capture sessions within the specified resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the Network Watcher resource. +// - options - PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.NewListPager method. +func (client *PacketCapturesClient) NewListPager(resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) *runtime.Pager[PacketCapturesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PacketCapturesClientListResponse]{ + More: func(page PacketCapturesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PacketCapturesClientListResponse) (PacketCapturesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + if err != nil { + return PacketCapturesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PacketCapturesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PacketCapturesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PacketCapturesClient) listHandleResponse(resp *http.Response) (PacketCapturesClientListResponse, error) { + result := PacketCapturesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PacketCaptureListResult); err != nil { + return PacketCapturesClientListResponse{}, err + } + return result, nil +} + +// BeginStop - Stops a specified packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - packetCaptureName - The name of the packet capture session. +// - options - PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop +// method. +func (client *PacketCapturesClient) BeginStop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*runtime.Poller[PacketCapturesClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PacketCapturesClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PacketCapturesClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Stop - Stops a specified packet capture session. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PacketCapturesClient) stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, networkWatcherName, packetCaptureName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *PacketCapturesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + if packetCaptureName == "" { + return nil, errors.New("parameter packetCaptureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packetCaptureName}", url.PathEscape(packetCaptureName)) + 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", "2022-09-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/network/armnetwork/v2/peerexpressroutecircuitconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/peerexpressroutecircuitconnections_client.go new file mode 100644 index 00000000000..00e6229c375 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/peerexpressroutecircuitconnections_client.go @@ -0,0 +1,189 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PeerExpressRouteCircuitConnectionsClient contains the methods for the PeerExpressRouteCircuitConnections group. +// Don't use this type directly, use NewPeerExpressRouteCircuitConnectionsClient() instead. +type PeerExpressRouteCircuitConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPeerExpressRouteCircuitConnectionsClient creates a new instance of PeerExpressRouteCircuitConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PeerExpressRouteCircuitConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".PeerExpressRouteCircuitConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PeerExpressRouteCircuitConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the express route circuit. +// - peeringName - The name of the peering. +// - connectionName - The name of the peer express route circuit connection. +// - options - PeerExpressRouteCircuitConnectionsClientGetOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.Get +// method. +func (client *PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (PeerExpressRouteCircuitConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, circuitName, peeringName, connectionName, options) + if err != nil { + return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PeerExpressRouteCircuitConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PeerExpressRouteCircuitConnectionsClient) getHandleResponse(resp *http.Response) (PeerExpressRouteCircuitConnectionsClientGetResponse, error) { + result := PeerExpressRouteCircuitConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PeerExpressRouteCircuitConnection); err != nil { + return PeerExpressRouteCircuitConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all global reach peer connections associated with a private peering in an express route circuit. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - circuitName - The name of the circuit. +// - peeringName - The name of the peering. +// - options - PeerExpressRouteCircuitConnectionsClientListOptions contains the optional parameters for the PeerExpressRouteCircuitConnectionsClient.NewListPager +// method. +func (client *PeerExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupName string, circuitName string, peeringName string, options *PeerExpressRouteCircuitConnectionsClientListOptions) *runtime.Pager[PeerExpressRouteCircuitConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PeerExpressRouteCircuitConnectionsClientListResponse]{ + More: func(page PeerExpressRouteCircuitConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PeerExpressRouteCircuitConnectionsClientListResponse) (PeerExpressRouteCircuitConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, circuitName, peeringName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PeerExpressRouteCircuitConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PeerExpressRouteCircuitConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PeerExpressRouteCircuitConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *PeerExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if circuitName == "" { + return nil, errors.New("parameter circuitName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{circuitName}", url.PathEscape(circuitName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PeerExpressRouteCircuitConnectionsClient) listHandleResponse(resp *http.Response) (PeerExpressRouteCircuitConnectionsClientListResponse, error) { + result := PeerExpressRouteCircuitConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PeerExpressRouteCircuitConnectionListResult); err != nil { + return PeerExpressRouteCircuitConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/polymorphic_helpers.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/polymorphic_helpers.go new file mode 100644 index 00000000000..882756d3f50 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/polymorphic_helpers.go @@ -0,0 +1,209 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +import "encoding/json" + +func unmarshalActiveBaseSecurityAdminRuleClassification(rawMsg json.RawMessage) (ActiveBaseSecurityAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ActiveBaseSecurityAdminRuleClassification + switch m["kind"] { + case string(EffectiveAdminRuleKindCustom): + b = &ActiveSecurityAdminRule{} + case string(EffectiveAdminRuleKindDefault): + b = &ActiveDefaultSecurityAdminRule{} + default: + b = &ActiveBaseSecurityAdminRule{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalActiveBaseSecurityAdminRuleClassificationArray(rawMsg json.RawMessage) ([]ActiveBaseSecurityAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]ActiveBaseSecurityAdminRuleClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalActiveBaseSecurityAdminRuleClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalBaseAdminRuleClassification(rawMsg json.RawMessage) (BaseAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b BaseAdminRuleClassification + switch m["kind"] { + case string(AdminRuleKindCustom): + b = &AdminRule{} + case string(AdminRuleKindDefault): + b = &DefaultAdminRule{} + default: + b = &BaseAdminRule{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalBaseAdminRuleClassificationArray(rawMsg json.RawMessage) ([]BaseAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]BaseAdminRuleClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalBaseAdminRuleClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalEffectiveBaseSecurityAdminRuleClassification(rawMsg json.RawMessage) (EffectiveBaseSecurityAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EffectiveBaseSecurityAdminRuleClassification + switch m["kind"] { + case string(EffectiveAdminRuleKindCustom): + b = &EffectiveSecurityAdminRule{} + case string(EffectiveAdminRuleKindDefault): + b = &EffectiveDefaultSecurityAdminRule{} + default: + b = &EffectiveBaseSecurityAdminRule{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEffectiveBaseSecurityAdminRuleClassificationArray(rawMsg json.RawMessage) ([]EffectiveBaseSecurityAdminRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]EffectiveBaseSecurityAdminRuleClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalEffectiveBaseSecurityAdminRuleClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalFirewallPolicyRuleClassification(rawMsg json.RawMessage) (FirewallPolicyRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FirewallPolicyRuleClassification + switch m["ruleType"] { + case string(FirewallPolicyRuleTypeApplicationRule): + b = &ApplicationRule{} + case string(FirewallPolicyRuleTypeNatRule): + b = &NatRule{} + case string(FirewallPolicyRuleTypeNetworkRule): + b = &Rule{} + default: + b = &FirewallPolicyRule{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalFirewallPolicyRuleClassificationArray(rawMsg json.RawMessage) ([]FirewallPolicyRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]FirewallPolicyRuleClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalFirewallPolicyRuleClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalFirewallPolicyRuleCollectionClassification(rawMsg json.RawMessage) (FirewallPolicyRuleCollectionClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FirewallPolicyRuleCollectionClassification + switch m["ruleCollectionType"] { + case string(FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection): + b = &FirewallPolicyFilterRuleCollection{} + case string(FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection): + b = &FirewallPolicyNatRuleCollection{} + default: + b = &FirewallPolicyRuleCollection{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalFirewallPolicyRuleCollectionClassificationArray(rawMsg json.RawMessage) ([]FirewallPolicyRuleCollectionClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]FirewallPolicyRuleCollectionClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalFirewallPolicyRuleCollectionClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatednszonegroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatednszonegroups_client.go new file mode 100644 index 00000000000..e7d94f5c1f1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatednszonegroups_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PrivateDNSZoneGroupsClient contains the methods for the PrivateDNSZoneGroups group. +// Don't use this type directly, use NewPrivateDNSZoneGroupsClient() instead. +type PrivateDNSZoneGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateDNSZoneGroupsClient creates a new instance of PrivateDNSZoneGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateDNSZoneGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateDNSZoneGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".PrivateDNSZoneGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateDNSZoneGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - privateDNSZoneGroupName - The name of the private dns zone group. +// - parameters - Parameters supplied to the create or update private dns zone group operation. +// - options - PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate +// method. +func (client *PrivateDNSZoneGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateDNSZoneGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateDNSZoneGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateDNSZoneGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a private dns zone group in the specified private endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateDNSZoneGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + if privateDNSZoneGroupName == "" { + return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified private dns zone group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - privateDNSZoneGroupName - The name of the private dns zone group. +// - options - PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete +// method. +func (client *PrivateDNSZoneGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*runtime.Poller[PrivateDNSZoneGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateDNSZoneGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateDNSZoneGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified private dns zone group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateDNSZoneGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + if privateDNSZoneGroupName == "" { + return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the private dns zone group resource by specified private dns zone group name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - privateDNSZoneGroupName - The name of the private dns zone group. +// - options - PrivateDNSZoneGroupsClientGetOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.Get +// method. +func (client *PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientGetOptions) (PrivateDNSZoneGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, options) + if err != nil { + return PrivateDNSZoneGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateDNSZoneGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateDNSZoneGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, options *PrivateDNSZoneGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + if privateDNSZoneGroupName == "" { + return nil, errors.New("parameter privateDNSZoneGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateDnsZoneGroupName}", url.PathEscape(privateDNSZoneGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) (PrivateDNSZoneGroupsClientGetResponse, error) { + result := PrivateDNSZoneGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateDNSZoneGroup); err != nil { + return PrivateDNSZoneGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all private dns zone groups in a private endpoint. +// +// Generated from API version 2022-09-01 +// - privateEndpointName - The name of the private endpoint. +// - resourceGroupName - The name of the resource group. +// - options - PrivateDNSZoneGroupsClientListOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.NewListPager +// method. +func (client *PrivateDNSZoneGroupsClient) NewListPager(privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) *runtime.Pager[PrivateDNSZoneGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateDNSZoneGroupsClientListResponse]{ + More: func(page PrivateDNSZoneGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateDNSZoneGroupsClientListResponse) (PrivateDNSZoneGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, privateEndpointName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateDNSZoneGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateDNSZoneGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateDNSZoneGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups" + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateDNSZoneGroupsClient) listHandleResponse(resp *http.Response) (PrivateDNSZoneGroupsClientListResponse, error) { + result := PrivateDNSZoneGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateDNSZoneGroupListResult); err != nil { + return PrivateDNSZoneGroupsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privateendpoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privateendpoints_client.go new file mode 100644 index 00000000000..ff5231393ce --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privateendpoints_client.go @@ -0,0 +1,366 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PrivateEndpointsClient contains the methods for the PrivateEndpoints group. +// Don't use this type directly, use NewPrivateEndpointsClient() instead. +type PrivateEndpointsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateEndpointsClient creates a new instance of PrivateEndpointsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointsClient, error) { + cl, err := arm.NewClient(moduleName+".PrivateEndpointsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateEndpointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an private endpoint in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - parameters - Parameters supplied to the create or update private endpoint operation. +// - options - PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate +// method. +func (client *PrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, privateEndpointName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an private endpoint in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, privateEndpointName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified private endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - options - PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete +// method. +func (client *PrivateEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, privateEndpointName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified private endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, privateEndpointName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified private endpoint by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - privateEndpointName - The name of the private endpoint. +// - options - PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. +func (client *PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (PrivateEndpointsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, privateEndpointName, options) + if err != nil { + return PrivateEndpointsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateEndpointName == "" { + return nil, errors.New("parameter privateEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointName}", url.PathEscape(privateEndpointName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (PrivateEndpointsClientGetResponse, error) { + result := PrivateEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpoint); err != nil { + return PrivateEndpointsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all private endpoints in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager +// method. +func (client *PrivateEndpointsClient) NewListPager(resourceGroupName string, options *PrivateEndpointsClientListOptions) *runtime.Pager[PrivateEndpointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointsClientListResponse]{ + More: func(page PrivateEndpointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointsClientListResponse) (PrivateEndpointsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateEndpointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (PrivateEndpointsClientListResponse, error) { + result := PrivateEndpointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointListResult); err != nil { + return PrivateEndpointsClientListResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets all private endpoints in a subscription. +// +// Generated from API version 2022-09-01 +// - options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager +// method. +func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointsClientListBySubscriptionResponse]{ + More: func(page PrivateEndpointsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointsClientListBySubscriptionResponse) (PrivateEndpointsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateEndpointsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateEndpointsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PrivateEndpointsClient) listBySubscriptionHandleResponse(resp *http.Response) (PrivateEndpointsClientListBySubscriptionResponse, error) { + result := PrivateEndpointsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointListResult); err != nil { + return PrivateEndpointsClientListBySubscriptionResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatelinkservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatelinkservices_client.go new file mode 100644 index 00000000000..57580681728 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/privatelinkservices_client.go @@ -0,0 +1,909 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PrivateLinkServicesClient contains the methods for the PrivateLinkServices group. +// Don't use this type directly, use NewPrivateLinkServicesClient() instead. +type PrivateLinkServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrivateLinkServicesClient creates a new instance of PrivateLinkServicesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrivateLinkServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkServicesClient, error) { + cl, err := arm.NewClient(moduleName+".PrivateLinkServicesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrivateLinkServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - parameters - The request body of CheckPrivateLinkService API call. +// - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the +// PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility method. +func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*runtime.Poller[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.checkPrivateLinkServiceVisibility(ctx, location, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CheckPrivateLinkServiceVisibility - Checks whether the subscription is visible to private link service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { + req, err := client.checkPrivateLinkServiceVisibilityCreateRequest(ctx, location, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// checkPrivateLinkServiceVisibilityCreateRequest creates the CheckPrivateLinkServiceVisibility request. +func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreateRequest(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service +// in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - resourceGroupName - The name of the resource group. +// - parameters - The request body of CheckPrivateLinkService API call. +// - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions contains the optional parameters +// for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup method. +func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*runtime.Poller[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.checkPrivateLinkServiceVisibilityByResourceGroup(ctx, location, resourceGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CheckPrivateLinkServiceVisibilityByResourceGroup - Checks whether the subscription is visible to private link service in +// the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*http.Response, error) { + req, err := client.checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx, location, resourceGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest creates the CheckPrivateLinkServiceVisibilityByResourceGroup request. +func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCreateOrUpdate - Creates or updates an private link service in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - parameters - Parameters supplied to the create or update private link service operation. +// - options - PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate +// method. +func (client *PrivateLinkServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateLinkServicesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates an private link service in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateLinkServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified private link service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - options - PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete +// method. +func (client *PrivateLinkServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*runtime.Poller[PrivateLinkServicesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified private link service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - peConnectionName - The name of the private end point connection. +// - options - PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the +// PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection method. +func (client *PrivateLinkServicesClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*runtime.Poller[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, serviceName, peConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DeletePrivateEndpointConnection - Delete private end point connection for a private link service in a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. +func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if peConnectionName == "" { + return nil, errors.New("parameter peConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified private link service by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - options - PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. +func (client *PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (PrivateLinkServicesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return PrivateLinkServicesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) (PrivateLinkServicesClientGetResponse, error) { + result := PrivateLinkServicesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkService); err != nil { + return PrivateLinkServicesClientGetResponse{}, err + } + return result, nil +} + +// GetPrivateEndpointConnection - Get the specific private end point connection by specific private link service in the resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - peConnectionName - The name of the private end point connection. +// - options - PrivateLinkServicesClientGetPrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.GetPrivateEndpointConnection +// method. +func (client *PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (PrivateLinkServicesClientGetPrivateEndpointConnectionResponse, error) { + req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, options) + if err != nil { + return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, runtime.NewResponseError(resp) + } + return client.getPrivateEndpointConnectionHandleResponse(resp) +} + +// getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. +func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientGetPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if peConnectionName == "" { + return nil, errors.New("parameter peConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. +func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (PrivateLinkServicesClientGetPrivateEndpointConnectionResponse, error) { + result := PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateLinkServicesClientGetPrivateEndpointConnectionResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all private link services in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager +// method. +func (client *PrivateLinkServicesClient) NewListPager(resourceGroupName string, options *PrivateLinkServicesClientListOptions) *runtime.Pager[PrivateLinkServicesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListResponse]{ + More: func(page PrivateLinkServicesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListResponse) (PrivateLinkServicesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkServicesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateLinkServicesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateLinkServicesClient) listHandleResponse(resp *http.Response) (PrivateLinkServicesClientListResponse, error) { + result := PrivateLinkServicesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkServiceListResult); err != nil { + return PrivateLinkServicesClientListResponse{}, err + } + return result, nil +} + +// NewListAutoApprovedPrivateLinkServicesPager - Returns all of the private link service ids that can be linked to a Private +// Endpoint with auto approved in this subscription in this region. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the +// PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager method. +func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesPager(location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) *runtime.Pager[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse]{ + More: func(page PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAutoApprovedPrivateLinkServicesCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, runtime.NewResponseError(resp) + } + return client.listAutoApprovedPrivateLinkServicesHandleResponse(resp) + }, + }) +} + +// listAutoApprovedPrivateLinkServicesCreateRequest creates the ListAutoApprovedPrivateLinkServices request. +func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCreateRequest(ctx context.Context, location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAutoApprovedPrivateLinkServicesHandleResponse handles the ListAutoApprovedPrivateLinkServices response. +func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesHandleResponse(resp *http.Response) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse, error) { + result := PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AutoApprovedPrivateLinkServicesResult); err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse{}, err + } + return result, nil +} + +// NewListAutoApprovedPrivateLinkServicesByResourceGroupPager - Returns all of the private link service ids that can be linked +// to a Private Endpoint with auto approved in this subscription in this region. +// +// Generated from API version 2022-09-01 +// - location - The location of the domain name. +// - resourceGroupName - The name of the resource group. +// - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters +// for the PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager method. +func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesByResourceGroupPager(location string, resourceGroupName string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) *runtime.Pager[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse]{ + More: func(page PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx, location, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse(resp) + }, + }) +} + +// listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest creates the ListAutoApprovedPrivateLinkServicesByResourceGroup request. +func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse handles the ListAutoApprovedPrivateLinkServicesByResourceGroup response. +func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupHandleResponse(resp *http.Response) (PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse, error) { + result := PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AutoApprovedPrivateLinkServicesResult); err != nil { + return PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets all private link service in a subscription. +// +// Generated from API version 2022-09-01 +// - options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager +// method. +func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListBySubscriptionResponse]{ + More: func(page PrivateLinkServicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListBySubscriptionResponse) (PrivateLinkServicesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkServicesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateLinkServicesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (PrivateLinkServicesClientListBySubscriptionResponse, error) { + result := PrivateLinkServicesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkServiceListResult); err != nil { + return PrivateLinkServicesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - options - PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager +// method. +func (client *PrivateLinkServicesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, serviceName string, options *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[PrivateLinkServicesClientListPrivateEndpointConnectionsResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkServicesClientListPrivateEndpointConnectionsResponse]{ + More: func(page PrivateLinkServicesClientListPrivateEndpointConnectionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkServicesClientListPrivateEndpointConnectionsResponse) (PrivateLinkServicesClientListPrivateEndpointConnectionsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, runtime.NewResponseError(resp) + } + return client.listPrivateEndpointConnectionsHandleResponse(resp) + }, + }) +} + +// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. +func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. +func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (PrivateLinkServicesClientListPrivateEndpointConnectionsResponse, error) { + result := PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { + return PrivateLinkServicesClientListPrivateEndpointConnectionsResponse{}, err + } + return result, nil +} + +// UpdatePrivateEndpointConnection - Approve or reject private end point connection for a private link service in a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceName - The name of the private link service. +// - peConnectionName - The name of the private end point connection. +// - parameters - Parameters supplied to approve or reject the private end point connection. +// - options - PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.UpdatePrivateEndpointConnection +// method. +func (client *PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection, options *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse, error) { + req, err := client.updatePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, serviceName, peConnectionName, parameters, options) + if err != nil { + return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, runtime.NewResponseError(resp) + } + return client.updatePrivateEndpointConnectionHandleResponse(resp) +} + +// updatePrivateEndpointConnectionCreateRequest creates the UpdatePrivateEndpointConnection request. +func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection, options *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if peConnectionName == "" { + return nil, errors.New("parameter peConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peConnectionName}", url.PathEscape(peConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updatePrivateEndpointConnectionHandleResponse handles the UpdatePrivateEndpointConnection response. +func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionHandleResponse(resp *http.Response) (PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse, error) { + result := PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/profiles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/profiles_client.go new file mode 100644 index 00000000000..9b38c8e71cb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/profiles_client.go @@ -0,0 +1,411 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ProfilesClient contains the methods for the NetworkProfiles group. +// Don't use this type directly, use NewProfilesClient() instead. +type ProfilesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewProfilesClient creates a new instance of ProfilesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error) { + cl, err := arm.NewClient(moduleName+".ProfilesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProfilesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a network profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkProfileName - The name of the network profile. +// - parameters - Parameters supplied to the create or update network profile operation. +// - options - ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method. +func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (ProfilesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkProfileName, parameters, options) + if err != nil { + return ProfilesClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProfilesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ProfilesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkProfileName == "" { + return nil, errors.New("parameter networkProfileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ProfilesClient) createOrUpdateHandleResponse(resp *http.Response) (ProfilesClientCreateOrUpdateResponse, error) { + result := ProfilesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { + return ProfilesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes the specified network profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkProfileName - The name of the NetworkProfile. +// - options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. +func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*runtime.Poller[ProfilesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkProfileName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkProfileName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkProfileName == "" { + return nil, errors.New("parameter networkProfileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified network profile in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkProfileName - The name of the public IP prefix. +// - options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. +func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkProfileName, options) + if err != nil { + return ProfilesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProfilesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProfilesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkProfileName == "" { + return nil, errors.New("parameter networkProfileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesClientGetResponse, error) { + result := ProfilesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { + return ProfilesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all network profiles in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. +func (client *ProfilesClient) NewListPager(resourceGroupName string, options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ + More: func(page ProfilesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProfilesClientListResponse) (ProfilesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProfilesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProfilesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProfilesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ProfilesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesClientListResponse, error) { + result := ProfilesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProfileListResult); err != nil { + return ProfilesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the network profiles in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ProfilesClientListAllOptions contains the optional parameters for the ProfilesClient.NewListAllPager method. +func (client *ProfilesClient) NewListAllPager(options *ProfilesClientListAllOptions) *runtime.Pager[ProfilesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[ProfilesClientListAllResponse]{ + More: func(page ProfilesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProfilesClientListAllResponse) (ProfilesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProfilesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProfilesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProfilesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options *ProfilesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *ProfilesClient) listAllHandleResponse(resp *http.Response) (ProfilesClientListAllResponse, error) { + result := ProfilesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProfileListResult); err != nil { + return ProfilesClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates network profile tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkProfileName - The name of the network profile. +// - parameters - Parameters supplied to update network profile tags. +// - options - ProfilesClientUpdateTagsOptions contains the optional parameters for the ProfilesClient.UpdateTags method. +func (client *ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, options *ProfilesClientUpdateTagsOptions) (ProfilesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkProfileName, parameters, options) + if err != nil { + return ProfilesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProfilesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProfilesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject, options *ProfilesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkProfileName == "" { + return nil, errors.New("parameter networkProfileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkProfileName}", url.PathEscape(networkProfileName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ProfilesClient) updateTagsHandleResponse(resp *http.Response) (ProfilesClientUpdateTagsResponse, error) { + result := ProfilesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Profile); err != nil { + return ProfilesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipaddresses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipaddresses_client.go new file mode 100644 index 00000000000..653cbef8ca0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipaddresses_client.go @@ -0,0 +1,967 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PublicIPAddressesClient contains the methods for the PublicIPAddresses group. +// Don't use this type directly, use NewPublicIPAddressesClient() instead. +type PublicIPAddressesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPublicIPAddressesClient creates a new instance of PublicIPAddressesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPublicIPAddressesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPAddressesClient, error) { + cl, err := arm.NewClient(moduleName+".PublicIPAddressesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PublicIPAddressesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a static or dynamic public IP address. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPAddressName - The name of the public IP address. +// - parameters - Parameters supplied to the create or update public IP address operation. +// - options - PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate +// method. +func (client *PublicIPAddressesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublicIPAddressesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publicIPAddressName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PublicIPAddressesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a static or dynamic public IP address. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PublicIPAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publicIPAddressName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPAddressName - The name of the public IP address. +// - options - PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus +// method. +func (client *PublicIPAddressesClient) BeginDdosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*runtime.Poller[PublicIPAddressesClientDdosProtectionStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.ddosProtectionStatus(ctx, resourceGroupName, publicIPAddressName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientDdosProtectionStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PublicIPAddressesClientDdosProtectionStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DdosProtectionStatus - Gets the Ddos Protection Status of a Public IP Address +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*http.Response, error) { + req, err := client.ddosProtectionStatusCreateRequest(ctx, resourceGroupName, publicIPAddressName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// ddosProtectionStatusCreateRequest creates the DdosProtectionStatus request. +func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDelete - Deletes the specified public IP address. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPAddressName - The name of the public IP address. +// - options - PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete +// method. +func (client *PublicIPAddressesClient) BeginDelete(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*runtime.Poller[PublicIPAddressesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publicIPAddressName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPAddressesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PublicIPAddressesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified public IP address. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publicIPAddressName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified public IP address in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPAddressName - The name of the public IP address. +// - options - PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. +func (client *PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (PublicIPAddressesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, publicIPAddressName, options) + if err != nil { + return PublicIPAddressesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PublicIPAddressesClient) getHandleResponse(resp *http.Response) (PublicIPAddressesClientGetResponse, error) { + result := PublicIPAddressesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { + return PublicIPAddressesClientGetResponse{}, err + } + return result, nil +} + +// GetCloudServicePublicIPAddress - Get the specified public IP address in a cloud service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - roleInstanceName - The role instance name. +// - networkInterfaceName - The name of the network interface. +// - ipConfigurationName - The name of the IP configuration. +// - publicIPAddressName - The name of the public IP Address. +// - options - PublicIPAddressesClientGetCloudServicePublicIPAddressOptions contains the optional parameters for the PublicIPAddressesClient.GetCloudServicePublicIPAddress +// method. +func (client *PublicIPAddressesClient) GetCloudServicePublicIPAddress(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetCloudServicePublicIPAddressOptions) (PublicIPAddressesClientGetCloudServicePublicIPAddressResponse, error) { + req, err := client.getCloudServicePublicIPAddressCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) + if err != nil { + return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, runtime.NewResponseError(resp) + } + return client.getCloudServicePublicIPAddressHandleResponse(resp) +} + +// getCloudServicePublicIPAddressCreateRequest creates the GetCloudServicePublicIPAddress request. +func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetCloudServicePublicIPAddressOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + if roleInstanceName == "" { + return nil, errors.New("parameter roleInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCloudServicePublicIPAddressHandleResponse handles the GetCloudServicePublicIPAddress response. +func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressHandleResponse(resp *http.Response) (PublicIPAddressesClientGetCloudServicePublicIPAddressResponse, error) { + result := PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { + return PublicIPAddressesClientGetCloudServicePublicIPAddressResponse{}, err + } + return result, nil +} + +// GetVirtualMachineScaleSetPublicIPAddress - Get the specified public IP address in a virtual machine scale set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - networkInterfaceName - The name of the network interface. +// - ipConfigurationName - The name of the IP configuration. +// - publicIPAddressName - The name of the public IP Address. +// - options - PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions contains the optional parameters for the +// PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress method. +func (client *PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { + req, err := client.getVirtualMachineScaleSetPublicIPAddressCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) + if err != nil { + return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, runtime.NewResponseError(resp) + } + return client.getVirtualMachineScaleSetPublicIPAddressHandleResponse(resp) +} + +// getVirtualMachineScaleSetPublicIPAddressCreateRequest creates the GetVirtualMachineScaleSetPublicIPAddress request. +func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2018-10-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getVirtualMachineScaleSetPublicIPAddressHandleResponse handles the GetVirtualMachineScaleSetPublicIPAddress response. +func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressHandleResponse(resp *http.Response) (PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { + result := PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { + return PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all public IP addresses in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager +// method. +func (client *PublicIPAddressesClient) NewListPager(resourceGroupName string, options *PublicIPAddressesClientListOptions) *runtime.Pager[PublicIPAddressesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListResponse]{ + More: func(page PublicIPAddressesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListResponse) (PublicIPAddressesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPAddressesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) (PublicIPAddressesClientListResponse, error) { + result := PublicIPAddressesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the public IP addresses in a subscription. +// +// Generated from API version 2022-09-01 +// - options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager +// method. +func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListAllResponse]{ + More: func(page PublicIPAddressesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListAllResponse) (PublicIPAddressesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, options *PublicIPAddressesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *PublicIPAddressesClient) listAllHandleResponse(resp *http.Response) (PublicIPAddressesClientListAllResponse, error) { + result := PublicIPAddressesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListAllResponse{}, err + } + return result, nil +} + +// NewListCloudServicePublicIPAddressesPager - Gets information about all public IP addresses on a cloud service level. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - options - PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager +// method. +func (client *PublicIPAddressesClient) NewListCloudServicePublicIPAddressesPager(resourceGroupName string, cloudServiceName string, options *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListCloudServicePublicIPAddressesResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListCloudServicePublicIPAddressesResponse]{ + More: func(page PublicIPAddressesClientListCloudServicePublicIPAddressesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListCloudServicePublicIPAddressesResponse) (PublicIPAddressesClientListCloudServicePublicIPAddressesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCloudServicePublicIPAddressesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, runtime.NewResponseError(resp) + } + return client.listCloudServicePublicIPAddressesHandleResponse(resp) + }, + }) +} + +// listCloudServicePublicIPAddressesCreateRequest creates the ListCloudServicePublicIPAddresses request. +func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCloudServicePublicIPAddressesHandleResponse handles the ListCloudServicePublicIPAddresses response. +func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListCloudServicePublicIPAddressesResponse, error) { + result := PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListCloudServicePublicIPAddressesResponse{}, err + } + return result, nil +} + +// NewListCloudServiceRoleInstancePublicIPAddressesPager - Gets information about all public IP addresses in a role instance +// IP configuration in a cloud service. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - cloudServiceName - The name of the cloud service. +// - roleInstanceName - The name of role instance. +// - networkInterfaceName - The network interface name. +// - ipConfigurationName - The IP configuration name. +// - options - PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions contains the optional parameters +// for the PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager method. +func (client *PublicIPAddressesClient) NewListCloudServiceRoleInstancePublicIPAddressesPager(resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse]{ + More: func(page PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse) (PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCloudServiceRoleInstancePublicIPAddressesCreateRequest(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, runtime.NewResponseError(resp) + } + return client.listCloudServiceRoleInstancePublicIPAddressesHandleResponse(resp) + }, + }) +} + +// listCloudServiceRoleInstancePublicIPAddressesCreateRequest creates the ListCloudServiceRoleInstancePublicIPAddresses request. +func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if cloudServiceName == "" { + return nil, errors.New("parameter cloudServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) + if roleInstanceName == "" { + return nil, errors.New("parameter roleInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCloudServiceRoleInstancePublicIPAddressesHandleResponse handles the ListCloudServiceRoleInstancePublicIPAddresses response. +func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse, error) { + result := PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse{}, err + } + return result, nil +} + +// NewListVirtualMachineScaleSetPublicIPAddressesPager - Gets information about all public IP addresses on a virtual machine +// scale set level. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - options - PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions contains the optional parameters for +// the PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager method. +func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetPublicIPAddressesPager(resourceGroupName string, virtualMachineScaleSetName string, options *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse]{ + More: func(page PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse) (PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, runtime.NewResponseError(resp) + } + return client.listVirtualMachineScaleSetPublicIPAddressesHandleResponse(resp) + }, + }) +} + +// listVirtualMachineScaleSetPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetPublicIPAddresses request. +func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + 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", "2018-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachineScaleSetPublicIPAddressesHandleResponse handles the ListVirtualMachineScaleSetPublicIPAddresses response. +func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse, error) { + result := PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse{}, err + } + return result, nil +} + +// NewListVirtualMachineScaleSetVMPublicIPAddressesPager - Gets information about all public IP addresses in a virtual machine +// IP configuration in a virtual machine scale set. +// +// Generated from API version 2018-10-01 +// - resourceGroupName - The name of the resource group. +// - virtualMachineScaleSetName - The name of the virtual machine scale set. +// - virtualmachineIndex - The virtual machine index. +// - networkInterfaceName - The network interface name. +// - ipConfigurationName - The IP configuration name. +// - options - PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions contains the optional parameters +// for the PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager method. +func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetVMPublicIPAddressesPager(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) *runtime.Pager[PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse]{ + More: func(page PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse) (PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, runtime.NewResponseError(resp) + } + return client.listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse(resp) + }, + }) +} + +// listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetVMPublicIPAddresses request. +func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualMachineScaleSetName == "" { + return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) + if virtualmachineIndex == "" { + return nil, errors.New("parameter virtualmachineIndex cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualmachineIndex}", url.PathEscape(virtualmachineIndex)) + if networkInterfaceName == "" { + return nil, errors.New("parameter networkInterfaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) + if ipConfigurationName == "" { + return nil, errors.New("parameter ipConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigurationName}", url.PathEscape(ipConfigurationName)) + 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", "2018-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse handles the ListVirtualMachineScaleSetVMPublicIPAddresses response. +func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesHandleResponse(resp *http.Response) (PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse, error) { + result := PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddressListResult); err != nil { + return PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates public IP address tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPAddressName - The name of the public IP address. +// - parameters - Parameters supplied to update public IP address tags. +// - options - PublicIPAddressesClientUpdateTagsOptions contains the optional parameters for the PublicIPAddressesClient.UpdateTags +// method. +func (client *PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject, options *PublicIPAddressesClientUpdateTagsOptions) (PublicIPAddressesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, publicIPAddressName, parameters, options) + if err != nil { + return PublicIPAddressesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPAddressesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPAddressesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject, options *PublicIPAddressesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPAddressName == "" { + return nil, errors.New("parameter publicIPAddressName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpAddressName}", url.PathEscape(publicIPAddressName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *PublicIPAddressesClient) updateTagsHandleResponse(resp *http.Response) (PublicIPAddressesClientUpdateTagsResponse, error) { + result := PublicIPAddressesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPAddress); err != nil { + return PublicIPAddressesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipprefixes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipprefixes_client.go new file mode 100644 index 00000000000..8c78d39a597 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/publicipprefixes_client.go @@ -0,0 +1,425 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// PublicIPPrefixesClient contains the methods for the PublicIPPrefixes group. +// Don't use this type directly, use NewPublicIPPrefixesClient() instead. +type PublicIPPrefixesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPublicIPPrefixesClient creates a new instance of PublicIPPrefixesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPublicIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicIPPrefixesClient, error) { + cl, err := arm.NewClient(moduleName+".PublicIPPrefixesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PublicIPPrefixesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a static or dynamic public IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPPrefixName - The name of the public IP prefix. +// - parameters - Parameters supplied to the create or update public IP prefix operation. +// - options - PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate +// method. +func (client *PublicIPPrefixesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublicIPPrefixesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, publicIPPrefixName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPPrefixesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PublicIPPrefixesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a static or dynamic public IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PublicIPPrefixesClient) createOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, publicIPPrefixName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPPrefixName == "" { + return nil, errors.New("parameter publicIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified public IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPPrefixName - The name of the PublicIpPrefix. +// - options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete +// method. +func (client *PublicIPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*runtime.Poller[PublicIPPrefixesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, publicIPPrefixName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PublicIPPrefixesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PublicIPPrefixesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified public IP prefix. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, publicIPPrefixName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPPrefixName == "" { + return nil, errors.New("parameter publicIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified public IP prefix in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPPrefixName - The name of the public IP prefix. +// - options - PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. +func (client *PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (PublicIPPrefixesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, publicIPPrefixName, options) + if err != nil { + return PublicIPPrefixesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPPrefixesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPPrefixesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPPrefixName == "" { + return nil, errors.New("parameter publicIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (PublicIPPrefixesClientGetResponse, error) { + result := PublicIPPrefixesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefix); err != nil { + return PublicIPPrefixesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all public IP prefixes in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager +// method. +func (client *PublicIPPrefixesClient) NewListPager(resourceGroupName string, options *PublicIPPrefixesClientListOptions) *runtime.Pager[PublicIPPrefixesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPPrefixesClientListResponse]{ + More: func(page PublicIPPrefixesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPPrefixesClientListResponse) (PublicIPPrefixesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPPrefixesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPPrefixesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPPrefixesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPPrefixesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (PublicIPPrefixesClientListResponse, error) { + result := PublicIPPrefixesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefixListResult); err != nil { + return PublicIPPrefixesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the public IP prefixes in a subscription. +// +// Generated from API version 2022-09-01 +// - options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager +// method. +func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[PublicIPPrefixesClientListAllResponse]{ + More: func(page PublicIPPrefixesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublicIPPrefixesClientListAllResponse) (PublicIPPrefixesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublicIPPrefixesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPPrefixesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPPrefixesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *PublicIPPrefixesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *PublicIPPrefixesClient) listAllHandleResponse(resp *http.Response) (PublicIPPrefixesClientListAllResponse, error) { + result := PublicIPPrefixesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefixListResult); err != nil { + return PublicIPPrefixesClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates public IP prefix tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - publicIPPrefixName - The name of the public IP prefix. +// - parameters - Parameters supplied to update public IP prefix tags. +// - options - PublicIPPrefixesClientUpdateTagsOptions contains the optional parameters for the PublicIPPrefixesClient.UpdateTags +// method. +func (client *PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject, options *PublicIPPrefixesClientUpdateTagsOptions) (PublicIPPrefixesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, publicIPPrefixName, parameters, options) + if err != nil { + return PublicIPPrefixesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublicIPPrefixesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublicIPPrefixesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject, options *PublicIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if publicIPPrefixName == "" { + return nil, errors.New("parameter publicIPPrefixName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicIpPrefixName}", url.PathEscape(publicIPPrefixName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *PublicIPPrefixesClient) updateTagsHandleResponse(resp *http.Response) (PublicIPPrefixesClientUpdateTagsResponse, error) { + result := PublicIPPrefixesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicIPPrefix); err != nil { + return PublicIPPrefixesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/resourcenavigationlinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/resourcenavigationlinks_client.go new file mode 100644 index 00000000000..02f6b4aaf0f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/resourcenavigationlinks_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ResourceNavigationLinksClient contains the methods for the ResourceNavigationLinks group. +// Don't use this type directly, use NewResourceNavigationLinksClient() instead. +type ResourceNavigationLinksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewResourceNavigationLinksClient creates a new instance of ResourceNavigationLinksClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewResourceNavigationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceNavigationLinksClient, error) { + cl, err := arm.NewClient(moduleName+".ResourceNavigationLinksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ResourceNavigationLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Gets a list of resource navigation links for a subnet. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - options - ResourceNavigationLinksClientListOptions contains the optional parameters for the ResourceNavigationLinksClient.List +// method. +func (client *ResourceNavigationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ResourceNavigationLinksClientListOptions) (ResourceNavigationLinksClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) + if err != nil { + return ResourceNavigationLinksClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ResourceNavigationLinksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ResourceNavigationLinksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ResourceNavigationLinksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ResourceNavigationLinksClient) listHandleResponse(resp *http.Response) (ResourceNavigationLinksClientListResponse, error) { + result := ResourceNavigationLinksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceNavigationLinksListResult); err != nil { + return ResourceNavigationLinksClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/response_types.go new file mode 100644 index 00000000000..abd176de333 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/response_types.go @@ -0,0 +1,3167 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +import "encoding/json" + +// AdminRuleCollectionsClientCreateOrUpdateResponse contains the response from method AdminRuleCollectionsClient.CreateOrUpdate. +type AdminRuleCollectionsClientCreateOrUpdateResponse struct { + AdminRuleCollection +} + +// AdminRuleCollectionsClientDeleteResponse contains the response from method AdminRuleCollectionsClient.BeginDelete. +type AdminRuleCollectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// AdminRuleCollectionsClientGetResponse contains the response from method AdminRuleCollectionsClient.Get. +type AdminRuleCollectionsClientGetResponse struct { + AdminRuleCollection +} + +// AdminRuleCollectionsClientListResponse contains the response from method AdminRuleCollectionsClient.NewListPager. +type AdminRuleCollectionsClientListResponse struct { + AdminRuleCollectionListResult +} + +// AdminRulesClientCreateOrUpdateResponse contains the response from method AdminRulesClient.CreateOrUpdate. +type AdminRulesClientCreateOrUpdateResponse struct { + BaseAdminRuleClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientCreateOrUpdateResponse. +func (a *AdminRulesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalBaseAdminRuleClassification(data) + if err != nil { + return err + } + a.BaseAdminRuleClassification = res + return nil +} + +// AdminRulesClientDeleteResponse contains the response from method AdminRulesClient.BeginDelete. +type AdminRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// AdminRulesClientGetResponse contains the response from method AdminRulesClient.Get. +type AdminRulesClientGetResponse struct { + BaseAdminRuleClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientGetResponse. +func (a *AdminRulesClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalBaseAdminRuleClassification(data) + if err != nil { + return err + } + a.BaseAdminRuleClassification = res + return nil +} + +// AdminRulesClientListResponse contains the response from method AdminRulesClient.NewListPager. +type AdminRulesClientListResponse struct { + AdminRuleListResult +} + +// ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete. +type ApplicationGatewayPrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationGatewayPrivateEndpointConnectionsClientGetResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.Get. +type ApplicationGatewayPrivateEndpointConnectionsClientGetResponse struct { + ApplicationGatewayPrivateEndpointConnection +} + +// ApplicationGatewayPrivateEndpointConnectionsClientListResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager. +type ApplicationGatewayPrivateEndpointConnectionsClientListResponse struct { + ApplicationGatewayPrivateEndpointConnectionListResult +} + +// ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse contains the response from method ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate. +type ApplicationGatewayPrivateEndpointConnectionsClientUpdateResponse struct { + ApplicationGatewayPrivateEndpointConnection +} + +// ApplicationGatewayPrivateLinkResourcesClientListResponse contains the response from method ApplicationGatewayPrivateLinkResourcesClient.NewListPager. +type ApplicationGatewayPrivateLinkResourcesClientListResponse struct { + ApplicationGatewayPrivateLinkResourceListResult +} + +// ApplicationGatewayWafDynamicManifestsClientGetResponse contains the response from method ApplicationGatewayWafDynamicManifestsClient.NewGetPager. +type ApplicationGatewayWafDynamicManifestsClientGetResponse struct { + ApplicationGatewayWafDynamicManifestResultList +} + +// ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse contains the response from method ApplicationGatewayWafDynamicManifestsDefaultClient.Get. +type ApplicationGatewayWafDynamicManifestsDefaultClientGetResponse struct { + ApplicationGatewayWafDynamicManifestResult +} + +// ApplicationGatewaysClientBackendHealthOnDemandResponse contains the response from method ApplicationGatewaysClient.BeginBackendHealthOnDemand. +type ApplicationGatewaysClientBackendHealthOnDemandResponse struct { + ApplicationGatewayBackendHealthOnDemand +} + +// ApplicationGatewaysClientBackendHealthResponse contains the response from method ApplicationGatewaysClient.BeginBackendHealth. +type ApplicationGatewaysClientBackendHealthResponse struct { + ApplicationGatewayBackendHealth +} + +// ApplicationGatewaysClientCreateOrUpdateResponse contains the response from method ApplicationGatewaysClient.BeginCreateOrUpdate. +type ApplicationGatewaysClientCreateOrUpdateResponse struct { + ApplicationGateway +} + +// ApplicationGatewaysClientDeleteResponse contains the response from method ApplicationGatewaysClient.BeginDelete. +type ApplicationGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationGatewaysClientGetResponse contains the response from method ApplicationGatewaysClient.Get. +type ApplicationGatewaysClientGetResponse struct { + ApplicationGateway +} + +// ApplicationGatewaysClientGetSSLPredefinedPolicyResponse contains the response from method ApplicationGatewaysClient.GetSSLPredefinedPolicy. +type ApplicationGatewaysClientGetSSLPredefinedPolicyResponse struct { + ApplicationGatewaySSLPredefinedPolicy +} + +// ApplicationGatewaysClientListAllResponse contains the response from method ApplicationGatewaysClient.NewListAllPager. +type ApplicationGatewaysClientListAllResponse struct { + ApplicationGatewayListResult +} + +// ApplicationGatewaysClientListAvailableRequestHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableRequestHeaders. +type ApplicationGatewaysClientListAvailableRequestHeadersResponse struct { + // Response for ApplicationGatewayAvailableRequestHeaders API service call. + StringArray []*string +} + +// ApplicationGatewaysClientListAvailableResponseHeadersResponse contains the response from method ApplicationGatewaysClient.ListAvailableResponseHeaders. +type ApplicationGatewaysClientListAvailableResponseHeadersResponse struct { + // Response for ApplicationGatewayAvailableResponseHeaders API service call. + StringArray []*string +} + +// ApplicationGatewaysClientListAvailableSSLOptionsResponse contains the response from method ApplicationGatewaysClient.ListAvailableSSLOptions. +type ApplicationGatewaysClientListAvailableSSLOptionsResponse struct { + ApplicationGatewayAvailableSSLOptions +} + +// ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse contains the response from method ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager. +type ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse struct { + ApplicationGatewayAvailableSSLPredefinedPolicies +} + +// ApplicationGatewaysClientListAvailableServerVariablesResponse contains the response from method ApplicationGatewaysClient.ListAvailableServerVariables. +type ApplicationGatewaysClientListAvailableServerVariablesResponse struct { + // Response for ApplicationGatewayAvailableServerVariables API service call. + StringArray []*string +} + +// ApplicationGatewaysClientListAvailableWafRuleSetsResponse contains the response from method ApplicationGatewaysClient.ListAvailableWafRuleSets. +type ApplicationGatewaysClientListAvailableWafRuleSetsResponse struct { + ApplicationGatewayAvailableWafRuleSetsResult +} + +// ApplicationGatewaysClientListResponse contains the response from method ApplicationGatewaysClient.NewListPager. +type ApplicationGatewaysClientListResponse struct { + ApplicationGatewayListResult +} + +// ApplicationGatewaysClientStartResponse contains the response from method ApplicationGatewaysClient.BeginStart. +type ApplicationGatewaysClientStartResponse struct { + // placeholder for future response values +} + +// ApplicationGatewaysClientStopResponse contains the response from method ApplicationGatewaysClient.BeginStop. +type ApplicationGatewaysClientStopResponse struct { + // placeholder for future response values +} + +// ApplicationGatewaysClientUpdateTagsResponse contains the response from method ApplicationGatewaysClient.UpdateTags. +type ApplicationGatewaysClientUpdateTagsResponse struct { + ApplicationGateway +} + +// ApplicationSecurityGroupsClientCreateOrUpdateResponse contains the response from method ApplicationSecurityGroupsClient.BeginCreateOrUpdate. +type ApplicationSecurityGroupsClientCreateOrUpdateResponse struct { + ApplicationSecurityGroup +} + +// ApplicationSecurityGroupsClientDeleteResponse contains the response from method ApplicationSecurityGroupsClient.BeginDelete. +type ApplicationSecurityGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationSecurityGroupsClientGetResponse contains the response from method ApplicationSecurityGroupsClient.Get. +type ApplicationSecurityGroupsClientGetResponse struct { + ApplicationSecurityGroup +} + +// ApplicationSecurityGroupsClientListAllResponse contains the response from method ApplicationSecurityGroupsClient.NewListAllPager. +type ApplicationSecurityGroupsClientListAllResponse struct { + ApplicationSecurityGroupListResult +} + +// ApplicationSecurityGroupsClientListResponse contains the response from method ApplicationSecurityGroupsClient.NewListPager. +type ApplicationSecurityGroupsClientListResponse struct { + ApplicationSecurityGroupListResult +} + +// ApplicationSecurityGroupsClientUpdateTagsResponse contains the response from method ApplicationSecurityGroupsClient.UpdateTags. +type ApplicationSecurityGroupsClientUpdateTagsResponse struct { + ApplicationSecurityGroup +} + +// AvailableDelegationsClientListResponse contains the response from method AvailableDelegationsClient.NewListPager. +type AvailableDelegationsClientListResponse struct { + AvailableDelegationsResult +} + +// AvailableEndpointServicesClientListResponse contains the response from method AvailableEndpointServicesClient.NewListPager. +type AvailableEndpointServicesClientListResponse struct { + EndpointServicesListResult +} + +// AvailablePrivateEndpointTypesClientListByResourceGroupResponse contains the response from method AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager. +type AvailablePrivateEndpointTypesClientListByResourceGroupResponse struct { + AvailablePrivateEndpointTypesResult +} + +// AvailablePrivateEndpointTypesClientListResponse contains the response from method AvailablePrivateEndpointTypesClient.NewListPager. +type AvailablePrivateEndpointTypesClientListResponse struct { + AvailablePrivateEndpointTypesResult +} + +// AvailableResourceGroupDelegationsClientListResponse contains the response from method AvailableResourceGroupDelegationsClient.NewListPager. +type AvailableResourceGroupDelegationsClientListResponse struct { + AvailableDelegationsResult +} + +// AvailableServiceAliasesClientListByResourceGroupResponse contains the response from method AvailableServiceAliasesClient.NewListByResourceGroupPager. +type AvailableServiceAliasesClientListByResourceGroupResponse struct { + AvailableServiceAliasesResult +} + +// AvailableServiceAliasesClientListResponse contains the response from method AvailableServiceAliasesClient.NewListPager. +type AvailableServiceAliasesClientListResponse struct { + AvailableServiceAliasesResult +} + +// AzureFirewallFqdnTagsClientListAllResponse contains the response from method AzureFirewallFqdnTagsClient.NewListAllPager. +type AzureFirewallFqdnTagsClientListAllResponse struct { + AzureFirewallFqdnTagListResult +} + +// AzureFirewallsClientCreateOrUpdateResponse contains the response from method AzureFirewallsClient.BeginCreateOrUpdate. +type AzureFirewallsClientCreateOrUpdateResponse struct { + AzureFirewall +} + +// AzureFirewallsClientDeleteResponse contains the response from method AzureFirewallsClient.BeginDelete. +type AzureFirewallsClientDeleteResponse struct { + // placeholder for future response values +} + +// AzureFirewallsClientGetResponse contains the response from method AzureFirewallsClient.Get. +type AzureFirewallsClientGetResponse struct { + AzureFirewall +} + +// AzureFirewallsClientListAllResponse contains the response from method AzureFirewallsClient.NewListAllPager. +type AzureFirewallsClientListAllResponse struct { + AzureFirewallListResult +} + +// AzureFirewallsClientListLearnedPrefixesResponse contains the response from method AzureFirewallsClient.BeginListLearnedPrefixes. +type AzureFirewallsClientListLearnedPrefixesResponse struct { + IPPrefixesList +} + +// AzureFirewallsClientListResponse contains the response from method AzureFirewallsClient.NewListPager. +type AzureFirewallsClientListResponse struct { + AzureFirewallListResult +} + +// AzureFirewallsClientUpdateTagsResponse contains the response from method AzureFirewallsClient.BeginUpdateTags. +type AzureFirewallsClientUpdateTagsResponse struct { + AzureFirewall +} + +// BastionHostsClientCreateOrUpdateResponse contains the response from method BastionHostsClient.BeginCreateOrUpdate. +type BastionHostsClientCreateOrUpdateResponse struct { + BastionHost +} + +// BastionHostsClientDeleteResponse contains the response from method BastionHostsClient.BeginDelete. +type BastionHostsClientDeleteResponse struct { + // placeholder for future response values +} + +// BastionHostsClientGetResponse contains the response from method BastionHostsClient.Get. +type BastionHostsClientGetResponse struct { + BastionHost +} + +// BastionHostsClientListByResourceGroupResponse contains the response from method BastionHostsClient.NewListByResourceGroupPager. +type BastionHostsClientListByResourceGroupResponse struct { + BastionHostListResult +} + +// BastionHostsClientListResponse contains the response from method BastionHostsClient.NewListPager. +type BastionHostsClientListResponse struct { + BastionHostListResult +} + +// BastionHostsClientUpdateTagsResponse contains the response from method BastionHostsClient.BeginUpdateTags. +type BastionHostsClientUpdateTagsResponse struct { + BastionHost +} + +// BgpServiceCommunitiesClientListResponse contains the response from method BgpServiceCommunitiesClient.NewListPager. +type BgpServiceCommunitiesClientListResponse struct { + BgpServiceCommunityListResult +} + +// ConfigurationPolicyGroupsClientCreateOrUpdateResponse contains the response from method ConfigurationPolicyGroupsClient.BeginCreateOrUpdate. +type ConfigurationPolicyGroupsClientCreateOrUpdateResponse struct { + VPNServerConfigurationPolicyGroup +} + +// ConfigurationPolicyGroupsClientDeleteResponse contains the response from method ConfigurationPolicyGroupsClient.BeginDelete. +type ConfigurationPolicyGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// ConfigurationPolicyGroupsClientGetResponse contains the response from method ConfigurationPolicyGroupsClient.Get. +type ConfigurationPolicyGroupsClientGetResponse struct { + VPNServerConfigurationPolicyGroup +} + +// ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse contains the response from method ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager. +type ConfigurationPolicyGroupsClientListByVPNServerConfigurationResponse struct { + ListVPNServerConfigurationPolicyGroupsResult +} + +// ConnectionMonitorsClientCreateOrUpdateResponse contains the response from method ConnectionMonitorsClient.BeginCreateOrUpdate. +type ConnectionMonitorsClientCreateOrUpdateResponse struct { + ConnectionMonitorResult +} + +// ConnectionMonitorsClientDeleteResponse contains the response from method ConnectionMonitorsClient.BeginDelete. +type ConnectionMonitorsClientDeleteResponse struct { + // placeholder for future response values +} + +// ConnectionMonitorsClientGetResponse contains the response from method ConnectionMonitorsClient.Get. +type ConnectionMonitorsClientGetResponse struct { + ConnectionMonitorResult +} + +// ConnectionMonitorsClientListResponse contains the response from method ConnectionMonitorsClient.NewListPager. +type ConnectionMonitorsClientListResponse struct { + ConnectionMonitorListResult +} + +// ConnectionMonitorsClientQueryResponse contains the response from method ConnectionMonitorsClient.BeginQuery. +type ConnectionMonitorsClientQueryResponse struct { + ConnectionMonitorQueryResult +} + +// ConnectionMonitorsClientStartResponse contains the response from method ConnectionMonitorsClient.BeginStart. +type ConnectionMonitorsClientStartResponse struct { + // placeholder for future response values +} + +// ConnectionMonitorsClientStopResponse contains the response from method ConnectionMonitorsClient.BeginStop. +type ConnectionMonitorsClientStopResponse struct { + // placeholder for future response values +} + +// ConnectionMonitorsClientUpdateTagsResponse contains the response from method ConnectionMonitorsClient.UpdateTags. +type ConnectionMonitorsClientUpdateTagsResponse struct { + ConnectionMonitorResult +} + +// ConnectivityConfigurationsClientCreateOrUpdateResponse contains the response from method ConnectivityConfigurationsClient.CreateOrUpdate. +type ConnectivityConfigurationsClientCreateOrUpdateResponse struct { + ConnectivityConfiguration +} + +// ConnectivityConfigurationsClientDeleteResponse contains the response from method ConnectivityConfigurationsClient.BeginDelete. +type ConnectivityConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// ConnectivityConfigurationsClientGetResponse contains the response from method ConnectivityConfigurationsClient.Get. +type ConnectivityConfigurationsClientGetResponse struct { + ConnectivityConfiguration +} + +// ConnectivityConfigurationsClientListResponse contains the response from method ConnectivityConfigurationsClient.NewListPager. +type ConnectivityConfigurationsClientListResponse struct { + ConnectivityConfigurationListResult +} + +// CustomIPPrefixesClientCreateOrUpdateResponse contains the response from method CustomIPPrefixesClient.BeginCreateOrUpdate. +type CustomIPPrefixesClientCreateOrUpdateResponse struct { + CustomIPPrefix +} + +// CustomIPPrefixesClientDeleteResponse contains the response from method CustomIPPrefixesClient.BeginDelete. +type CustomIPPrefixesClientDeleteResponse struct { + // placeholder for future response values +} + +// CustomIPPrefixesClientGetResponse contains the response from method CustomIPPrefixesClient.Get. +type CustomIPPrefixesClientGetResponse struct { + CustomIPPrefix +} + +// CustomIPPrefixesClientListAllResponse contains the response from method CustomIPPrefixesClient.NewListAllPager. +type CustomIPPrefixesClientListAllResponse struct { + CustomIPPrefixListResult +} + +// CustomIPPrefixesClientListResponse contains the response from method CustomIPPrefixesClient.NewListPager. +type CustomIPPrefixesClientListResponse struct { + CustomIPPrefixListResult +} + +// CustomIPPrefixesClientUpdateTagsResponse contains the response from method CustomIPPrefixesClient.UpdateTags. +type CustomIPPrefixesClientUpdateTagsResponse struct { + CustomIPPrefix +} + +// DdosCustomPoliciesClientCreateOrUpdateResponse contains the response from method DdosCustomPoliciesClient.BeginCreateOrUpdate. +type DdosCustomPoliciesClientCreateOrUpdateResponse struct { + DdosCustomPolicy +} + +// DdosCustomPoliciesClientDeleteResponse contains the response from method DdosCustomPoliciesClient.BeginDelete. +type DdosCustomPoliciesClientDeleteResponse struct { + // placeholder for future response values +} + +// DdosCustomPoliciesClientGetResponse contains the response from method DdosCustomPoliciesClient.Get. +type DdosCustomPoliciesClientGetResponse struct { + DdosCustomPolicy +} + +// DdosCustomPoliciesClientUpdateTagsResponse contains the response from method DdosCustomPoliciesClient.UpdateTags. +type DdosCustomPoliciesClientUpdateTagsResponse struct { + DdosCustomPolicy +} + +// DdosProtectionPlansClientCreateOrUpdateResponse contains the response from method DdosProtectionPlansClient.BeginCreateOrUpdate. +type DdosProtectionPlansClientCreateOrUpdateResponse struct { + DdosProtectionPlan +} + +// DdosProtectionPlansClientDeleteResponse contains the response from method DdosProtectionPlansClient.BeginDelete. +type DdosProtectionPlansClientDeleteResponse struct { + // placeholder for future response values +} + +// DdosProtectionPlansClientGetResponse contains the response from method DdosProtectionPlansClient.Get. +type DdosProtectionPlansClientGetResponse struct { + DdosProtectionPlan +} + +// DdosProtectionPlansClientListByResourceGroupResponse contains the response from method DdosProtectionPlansClient.NewListByResourceGroupPager. +type DdosProtectionPlansClientListByResourceGroupResponse struct { + DdosProtectionPlanListResult +} + +// DdosProtectionPlansClientListResponse contains the response from method DdosProtectionPlansClient.NewListPager. +type DdosProtectionPlansClientListResponse struct { + DdosProtectionPlanListResult +} + +// DdosProtectionPlansClientUpdateTagsResponse contains the response from method DdosProtectionPlansClient.UpdateTags. +type DdosProtectionPlansClientUpdateTagsResponse struct { + DdosProtectionPlan +} + +// DefaultSecurityRulesClientGetResponse contains the response from method DefaultSecurityRulesClient.Get. +type DefaultSecurityRulesClientGetResponse struct { + SecurityRule +} + +// DefaultSecurityRulesClientListResponse contains the response from method DefaultSecurityRulesClient.NewListPager. +type DefaultSecurityRulesClientListResponse struct { + SecurityRuleListResult +} + +// DscpConfigurationClientCreateOrUpdateResponse contains the response from method DscpConfigurationClient.BeginCreateOrUpdate. +type DscpConfigurationClientCreateOrUpdateResponse struct { + DscpConfiguration +} + +// DscpConfigurationClientDeleteResponse contains the response from method DscpConfigurationClient.BeginDelete. +type DscpConfigurationClientDeleteResponse struct { + // placeholder for future response values +} + +// DscpConfigurationClientGetResponse contains the response from method DscpConfigurationClient.Get. +type DscpConfigurationClientGetResponse struct { + DscpConfiguration +} + +// DscpConfigurationClientListAllResponse contains the response from method DscpConfigurationClient.NewListAllPager. +type DscpConfigurationClientListAllResponse struct { + DscpConfigurationListResult +} + +// DscpConfigurationClientListResponse contains the response from method DscpConfigurationClient.NewListPager. +type DscpConfigurationClientListResponse struct { + DscpConfigurationListResult +} + +// ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate. +type ExpressRouteCircuitAuthorizationsClientCreateOrUpdateResponse struct { + ExpressRouteCircuitAuthorization +} + +// ExpressRouteCircuitAuthorizationsClientDeleteResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.BeginDelete. +type ExpressRouteCircuitAuthorizationsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteCircuitAuthorizationsClientGetResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.Get. +type ExpressRouteCircuitAuthorizationsClientGetResponse struct { + ExpressRouteCircuitAuthorization +} + +// ExpressRouteCircuitAuthorizationsClientListResponse contains the response from method ExpressRouteCircuitAuthorizationsClient.NewListPager. +type ExpressRouteCircuitAuthorizationsClientListResponse struct { + AuthorizationListResult +} + +// ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate. +type ExpressRouteCircuitConnectionsClientCreateOrUpdateResponse struct { + ExpressRouteCircuitConnection +} + +// ExpressRouteCircuitConnectionsClientDeleteResponse contains the response from method ExpressRouteCircuitConnectionsClient.BeginDelete. +type ExpressRouteCircuitConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteCircuitConnectionsClientGetResponse contains the response from method ExpressRouteCircuitConnectionsClient.Get. +type ExpressRouteCircuitConnectionsClientGetResponse struct { + ExpressRouteCircuitConnection +} + +// ExpressRouteCircuitConnectionsClientListResponse contains the response from method ExpressRouteCircuitConnectionsClient.NewListPager. +type ExpressRouteCircuitConnectionsClientListResponse struct { + ExpressRouteCircuitConnectionListResult +} + +// ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate. +type ExpressRouteCircuitPeeringsClientCreateOrUpdateResponse struct { + ExpressRouteCircuitPeering +} + +// ExpressRouteCircuitPeeringsClientDeleteResponse contains the response from method ExpressRouteCircuitPeeringsClient.BeginDelete. +type ExpressRouteCircuitPeeringsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteCircuitPeeringsClientGetResponse contains the response from method ExpressRouteCircuitPeeringsClient.Get. +type ExpressRouteCircuitPeeringsClientGetResponse struct { + ExpressRouteCircuitPeering +} + +// ExpressRouteCircuitPeeringsClientListResponse contains the response from method ExpressRouteCircuitPeeringsClient.NewListPager. +type ExpressRouteCircuitPeeringsClientListResponse struct { + ExpressRouteCircuitPeeringListResult +} + +// ExpressRouteCircuitsClientCreateOrUpdateResponse contains the response from method ExpressRouteCircuitsClient.BeginCreateOrUpdate. +type ExpressRouteCircuitsClientCreateOrUpdateResponse struct { + ExpressRouteCircuit +} + +// ExpressRouteCircuitsClientDeleteResponse contains the response from method ExpressRouteCircuitsClient.BeginDelete. +type ExpressRouteCircuitsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteCircuitsClientGetPeeringStatsResponse contains the response from method ExpressRouteCircuitsClient.GetPeeringStats. +type ExpressRouteCircuitsClientGetPeeringStatsResponse struct { + ExpressRouteCircuitStats +} + +// ExpressRouteCircuitsClientGetResponse contains the response from method ExpressRouteCircuitsClient.Get. +type ExpressRouteCircuitsClientGetResponse struct { + ExpressRouteCircuit +} + +// ExpressRouteCircuitsClientGetStatsResponse contains the response from method ExpressRouteCircuitsClient.GetStats. +type ExpressRouteCircuitsClientGetStatsResponse struct { + ExpressRouteCircuitStats +} + +// ExpressRouteCircuitsClientListAllResponse contains the response from method ExpressRouteCircuitsClient.NewListAllPager. +type ExpressRouteCircuitsClientListAllResponse struct { + ExpressRouteCircuitListResult +} + +// ExpressRouteCircuitsClientListArpTableResponse contains the response from method ExpressRouteCircuitsClient.BeginListArpTable. +type ExpressRouteCircuitsClientListArpTableResponse struct { + ExpressRouteCircuitsArpTableListResult +} + +// ExpressRouteCircuitsClientListResponse contains the response from method ExpressRouteCircuitsClient.NewListPager. +type ExpressRouteCircuitsClientListResponse struct { + ExpressRouteCircuitListResult +} + +// ExpressRouteCircuitsClientListRoutesTableResponse contains the response from method ExpressRouteCircuitsClient.BeginListRoutesTable. +type ExpressRouteCircuitsClientListRoutesTableResponse struct { + ExpressRouteCircuitsRoutesTableListResult +} + +// ExpressRouteCircuitsClientListRoutesTableSummaryResponse contains the response from method ExpressRouteCircuitsClient.BeginListRoutesTableSummary. +type ExpressRouteCircuitsClientListRoutesTableSummaryResponse struct { + ExpressRouteCircuitsRoutesTableSummaryListResult +} + +// ExpressRouteCircuitsClientUpdateTagsResponse contains the response from method ExpressRouteCircuitsClient.UpdateTags. +type ExpressRouteCircuitsClientUpdateTagsResponse struct { + ExpressRouteCircuit +} + +// ExpressRouteConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteConnectionsClient.BeginCreateOrUpdate. +type ExpressRouteConnectionsClientCreateOrUpdateResponse struct { + ExpressRouteConnection +} + +// ExpressRouteConnectionsClientDeleteResponse contains the response from method ExpressRouteConnectionsClient.BeginDelete. +type ExpressRouteConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteConnectionsClientGetResponse contains the response from method ExpressRouteConnectionsClient.Get. +type ExpressRouteConnectionsClientGetResponse struct { + ExpressRouteConnection +} + +// ExpressRouteConnectionsClientListResponse contains the response from method ExpressRouteConnectionsClient.List. +type ExpressRouteConnectionsClientListResponse struct { + ExpressRouteConnectionList +} + +// ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate. +type ExpressRouteCrossConnectionPeeringsClientCreateOrUpdateResponse struct { + ExpressRouteCrossConnectionPeering +} + +// ExpressRouteCrossConnectionPeeringsClientDeleteResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.BeginDelete. +type ExpressRouteCrossConnectionPeeringsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteCrossConnectionPeeringsClientGetResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.Get. +type ExpressRouteCrossConnectionPeeringsClientGetResponse struct { + ExpressRouteCrossConnectionPeering +} + +// ExpressRouteCrossConnectionPeeringsClientListResponse contains the response from method ExpressRouteCrossConnectionPeeringsClient.NewListPager. +type ExpressRouteCrossConnectionPeeringsClientListResponse struct { + ExpressRouteCrossConnectionPeeringList +} + +// ExpressRouteCrossConnectionsClientCreateOrUpdateResponse contains the response from method ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate. +type ExpressRouteCrossConnectionsClientCreateOrUpdateResponse struct { + ExpressRouteCrossConnection +} + +// ExpressRouteCrossConnectionsClientGetResponse contains the response from method ExpressRouteCrossConnectionsClient.Get. +type ExpressRouteCrossConnectionsClientGetResponse struct { + ExpressRouteCrossConnection +} + +// ExpressRouteCrossConnectionsClientListArpTableResponse contains the response from method ExpressRouteCrossConnectionsClient.BeginListArpTable. +type ExpressRouteCrossConnectionsClientListArpTableResponse struct { + ExpressRouteCircuitsArpTableListResult +} + +// ExpressRouteCrossConnectionsClientListByResourceGroupResponse contains the response from method ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager. +type ExpressRouteCrossConnectionsClientListByResourceGroupResponse struct { + ExpressRouteCrossConnectionListResult +} + +// ExpressRouteCrossConnectionsClientListResponse contains the response from method ExpressRouteCrossConnectionsClient.NewListPager. +type ExpressRouteCrossConnectionsClientListResponse struct { + ExpressRouteCrossConnectionListResult +} + +// ExpressRouteCrossConnectionsClientListRoutesTableResponse contains the response from method ExpressRouteCrossConnectionsClient.BeginListRoutesTable. +type ExpressRouteCrossConnectionsClientListRoutesTableResponse struct { + ExpressRouteCircuitsRoutesTableListResult +} + +// ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse contains the response from method ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary. +type ExpressRouteCrossConnectionsClientListRoutesTableSummaryResponse struct { + ExpressRouteCrossConnectionsRoutesTableSummaryListResult +} + +// ExpressRouteCrossConnectionsClientUpdateTagsResponse contains the response from method ExpressRouteCrossConnectionsClient.UpdateTags. +type ExpressRouteCrossConnectionsClientUpdateTagsResponse struct { + ExpressRouteCrossConnection +} + +// ExpressRouteGatewaysClientCreateOrUpdateResponse contains the response from method ExpressRouteGatewaysClient.BeginCreateOrUpdate. +type ExpressRouteGatewaysClientCreateOrUpdateResponse struct { + ExpressRouteGateway +} + +// ExpressRouteGatewaysClientDeleteResponse contains the response from method ExpressRouteGatewaysClient.BeginDelete. +type ExpressRouteGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRouteGatewaysClientGetResponse contains the response from method ExpressRouteGatewaysClient.Get. +type ExpressRouteGatewaysClientGetResponse struct { + ExpressRouteGateway +} + +// ExpressRouteGatewaysClientListByResourceGroupResponse contains the response from method ExpressRouteGatewaysClient.ListByResourceGroup. +type ExpressRouteGatewaysClientListByResourceGroupResponse struct { + ExpressRouteGatewayList +} + +// ExpressRouteGatewaysClientListBySubscriptionResponse contains the response from method ExpressRouteGatewaysClient.ListBySubscription. +type ExpressRouteGatewaysClientListBySubscriptionResponse struct { + ExpressRouteGatewayList +} + +// ExpressRouteGatewaysClientUpdateTagsResponse contains the response from method ExpressRouteGatewaysClient.BeginUpdateTags. +type ExpressRouteGatewaysClientUpdateTagsResponse struct { + ExpressRouteGateway +} + +// ExpressRouteLinksClientGetResponse contains the response from method ExpressRouteLinksClient.Get. +type ExpressRouteLinksClientGetResponse struct { + ExpressRouteLink +} + +// ExpressRouteLinksClientListResponse contains the response from method ExpressRouteLinksClient.NewListPager. +type ExpressRouteLinksClientListResponse struct { + ExpressRouteLinkListResult +} + +// ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate. +type ExpressRoutePortAuthorizationsClientCreateOrUpdateResponse struct { + ExpressRoutePortAuthorization +} + +// ExpressRoutePortAuthorizationsClientDeleteResponse contains the response from method ExpressRoutePortAuthorizationsClient.BeginDelete. +type ExpressRoutePortAuthorizationsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRoutePortAuthorizationsClientGetResponse contains the response from method ExpressRoutePortAuthorizationsClient.Get. +type ExpressRoutePortAuthorizationsClientGetResponse struct { + ExpressRoutePortAuthorization +} + +// ExpressRoutePortAuthorizationsClientListResponse contains the response from method ExpressRoutePortAuthorizationsClient.NewListPager. +type ExpressRoutePortAuthorizationsClientListResponse struct { + ExpressRoutePortAuthorizationListResult +} + +// ExpressRoutePortsClientCreateOrUpdateResponse contains the response from method ExpressRoutePortsClient.BeginCreateOrUpdate. +type ExpressRoutePortsClientCreateOrUpdateResponse struct { + ExpressRoutePort +} + +// ExpressRoutePortsClientDeleteResponse contains the response from method ExpressRoutePortsClient.BeginDelete. +type ExpressRoutePortsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExpressRoutePortsClientGenerateLOAResponse contains the response from method ExpressRoutePortsClient.GenerateLOA. +type ExpressRoutePortsClientGenerateLOAResponse struct { + GenerateExpressRoutePortsLOAResult +} + +// ExpressRoutePortsClientGetResponse contains the response from method ExpressRoutePortsClient.Get. +type ExpressRoutePortsClientGetResponse struct { + ExpressRoutePort +} + +// ExpressRoutePortsClientListByResourceGroupResponse contains the response from method ExpressRoutePortsClient.NewListByResourceGroupPager. +type ExpressRoutePortsClientListByResourceGroupResponse struct { + ExpressRoutePortListResult +} + +// ExpressRoutePortsClientListResponse contains the response from method ExpressRoutePortsClient.NewListPager. +type ExpressRoutePortsClientListResponse struct { + ExpressRoutePortListResult +} + +// ExpressRoutePortsClientUpdateTagsResponse contains the response from method ExpressRoutePortsClient.UpdateTags. +type ExpressRoutePortsClientUpdateTagsResponse struct { + ExpressRoutePort +} + +// ExpressRoutePortsLocationsClientGetResponse contains the response from method ExpressRoutePortsLocationsClient.Get. +type ExpressRoutePortsLocationsClientGetResponse struct { + ExpressRoutePortsLocation +} + +// ExpressRoutePortsLocationsClientListResponse contains the response from method ExpressRoutePortsLocationsClient.NewListPager. +type ExpressRoutePortsLocationsClientListResponse struct { + ExpressRoutePortsLocationListResult +} + +// ExpressRouteProviderPortsLocationClientListResponse contains the response from method ExpressRouteProviderPortsLocationClient.List. +type ExpressRouteProviderPortsLocationClientListResponse struct { + ExpressRouteProviderPortListResult +} + +// ExpressRouteServiceProvidersClientListResponse contains the response from method ExpressRouteServiceProvidersClient.NewListPager. +type ExpressRouteServiceProvidersClientListResponse struct { + ExpressRouteServiceProviderListResult +} + +// FirewallPoliciesClientCreateOrUpdateResponse contains the response from method FirewallPoliciesClient.BeginCreateOrUpdate. +type FirewallPoliciesClientCreateOrUpdateResponse struct { + FirewallPolicy +} + +// FirewallPoliciesClientDeleteResponse contains the response from method FirewallPoliciesClient.BeginDelete. +type FirewallPoliciesClientDeleteResponse struct { + // placeholder for future response values +} + +// FirewallPoliciesClientGetResponse contains the response from method FirewallPoliciesClient.Get. +type FirewallPoliciesClientGetResponse struct { + FirewallPolicy +} + +// FirewallPoliciesClientListAllResponse contains the response from method FirewallPoliciesClient.NewListAllPager. +type FirewallPoliciesClientListAllResponse struct { + FirewallPolicyListResult +} + +// FirewallPoliciesClientListResponse contains the response from method FirewallPoliciesClient.NewListPager. +type FirewallPoliciesClientListResponse struct { + FirewallPolicyListResult +} + +// FirewallPoliciesClientUpdateTagsResponse contains the response from method FirewallPoliciesClient.UpdateTags. +type FirewallPoliciesClientUpdateTagsResponse struct { + FirewallPolicy +} + +// FirewallPolicyIdpsSignaturesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesClient.List. +type FirewallPolicyIdpsSignaturesClientListResponse struct { + QueryResults +} + +// FirewallPolicyIdpsSignaturesFilterValuesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesFilterValuesClient.List. +type FirewallPolicyIdpsSignaturesFilterValuesClientListResponse struct { + SignatureOverridesFilterValuesResponse +} + +// FirewallPolicyIdpsSignaturesOverridesClientGetResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Get. +type FirewallPolicyIdpsSignaturesOverridesClientGetResponse struct { + SignaturesOverrides +} + +// FirewallPolicyIdpsSignaturesOverridesClientListResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.List. +type FirewallPolicyIdpsSignaturesOverridesClientListResponse struct { + SignaturesOverridesList +} + +// FirewallPolicyIdpsSignaturesOverridesClientPatchResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Patch. +type FirewallPolicyIdpsSignaturesOverridesClientPatchResponse struct { + SignaturesOverrides +} + +// FirewallPolicyIdpsSignaturesOverridesClientPutResponse contains the response from method FirewallPolicyIdpsSignaturesOverridesClient.Put. +type FirewallPolicyIdpsSignaturesOverridesClientPutResponse struct { + SignaturesOverrides +} + +// FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate. +type FirewallPolicyRuleCollectionGroupsClientCreateOrUpdateResponse struct { + FirewallPolicyRuleCollectionGroup +} + +// FirewallPolicyRuleCollectionGroupsClientDeleteResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.BeginDelete. +type FirewallPolicyRuleCollectionGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// FirewallPolicyRuleCollectionGroupsClientGetResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.Get. +type FirewallPolicyRuleCollectionGroupsClientGetResponse struct { + FirewallPolicyRuleCollectionGroup +} + +// FirewallPolicyRuleCollectionGroupsClientListResponse contains the response from method FirewallPolicyRuleCollectionGroupsClient.NewListPager. +type FirewallPolicyRuleCollectionGroupsClientListResponse struct { + FirewallPolicyRuleCollectionGroupListResult +} + +// FlowLogsClientCreateOrUpdateResponse contains the response from method FlowLogsClient.BeginCreateOrUpdate. +type FlowLogsClientCreateOrUpdateResponse struct { + FlowLog +} + +// FlowLogsClientDeleteResponse contains the response from method FlowLogsClient.BeginDelete. +type FlowLogsClientDeleteResponse struct { + // placeholder for future response values +} + +// FlowLogsClientGetResponse contains the response from method FlowLogsClient.Get. +type FlowLogsClientGetResponse struct { + FlowLog +} + +// FlowLogsClientListResponse contains the response from method FlowLogsClient.NewListPager. +type FlowLogsClientListResponse struct { + FlowLogListResult +} + +// FlowLogsClientUpdateTagsResponse contains the response from method FlowLogsClient.UpdateTags. +type FlowLogsClientUpdateTagsResponse struct { + FlowLog +} + +// GroupsClientCreateOrUpdateResponse contains the response from method GroupsClient.CreateOrUpdate. +type GroupsClientCreateOrUpdateResponse struct { + Group + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GroupsClientDeleteResponse contains the response from method GroupsClient.BeginDelete. +type GroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// GroupsClientGetResponse contains the response from method GroupsClient.Get. +type GroupsClientGetResponse struct { + Group +} + +// GroupsClientListResponse contains the response from method GroupsClient.NewListPager. +type GroupsClientListResponse struct { + GroupListResult +} + +// HubRouteTablesClientCreateOrUpdateResponse contains the response from method HubRouteTablesClient.BeginCreateOrUpdate. +type HubRouteTablesClientCreateOrUpdateResponse struct { + HubRouteTable +} + +// HubRouteTablesClientDeleteResponse contains the response from method HubRouteTablesClient.BeginDelete. +type HubRouteTablesClientDeleteResponse struct { + // placeholder for future response values +} + +// HubRouteTablesClientGetResponse contains the response from method HubRouteTablesClient.Get. +type HubRouteTablesClientGetResponse struct { + HubRouteTable +} + +// HubRouteTablesClientListResponse contains the response from method HubRouteTablesClient.NewListPager. +type HubRouteTablesClientListResponse struct { + ListHubRouteTablesResult +} + +// HubVirtualNetworkConnectionsClientCreateOrUpdateResponse contains the response from method HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate. +type HubVirtualNetworkConnectionsClientCreateOrUpdateResponse struct { + HubVirtualNetworkConnection +} + +// HubVirtualNetworkConnectionsClientDeleteResponse contains the response from method HubVirtualNetworkConnectionsClient.BeginDelete. +type HubVirtualNetworkConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// HubVirtualNetworkConnectionsClientGetResponse contains the response from method HubVirtualNetworkConnectionsClient.Get. +type HubVirtualNetworkConnectionsClientGetResponse struct { + HubVirtualNetworkConnection +} + +// HubVirtualNetworkConnectionsClientListResponse contains the response from method HubVirtualNetworkConnectionsClient.NewListPager. +type HubVirtualNetworkConnectionsClientListResponse struct { + ListHubVirtualNetworkConnectionsResult +} + +// IPAllocationsClientCreateOrUpdateResponse contains the response from method IPAllocationsClient.BeginCreateOrUpdate. +type IPAllocationsClientCreateOrUpdateResponse struct { + IPAllocation +} + +// IPAllocationsClientDeleteResponse contains the response from method IPAllocationsClient.BeginDelete. +type IPAllocationsClientDeleteResponse struct { + // placeholder for future response values +} + +// IPAllocationsClientGetResponse contains the response from method IPAllocationsClient.Get. +type IPAllocationsClientGetResponse struct { + IPAllocation +} + +// IPAllocationsClientListByResourceGroupResponse contains the response from method IPAllocationsClient.NewListByResourceGroupPager. +type IPAllocationsClientListByResourceGroupResponse struct { + IPAllocationListResult +} + +// IPAllocationsClientListResponse contains the response from method IPAllocationsClient.NewListPager. +type IPAllocationsClientListResponse struct { + IPAllocationListResult +} + +// IPAllocationsClientUpdateTagsResponse contains the response from method IPAllocationsClient.UpdateTags. +type IPAllocationsClientUpdateTagsResponse struct { + IPAllocation +} + +// IPGroupsClientCreateOrUpdateResponse contains the response from method IPGroupsClient.BeginCreateOrUpdate. +type IPGroupsClientCreateOrUpdateResponse struct { + IPGroup +} + +// IPGroupsClientDeleteResponse contains the response from method IPGroupsClient.BeginDelete. +type IPGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// IPGroupsClientGetResponse contains the response from method IPGroupsClient.Get. +type IPGroupsClientGetResponse struct { + IPGroup +} + +// IPGroupsClientListByResourceGroupResponse contains the response from method IPGroupsClient.NewListByResourceGroupPager. +type IPGroupsClientListByResourceGroupResponse struct { + IPGroupListResult +} + +// IPGroupsClientListResponse contains the response from method IPGroupsClient.NewListPager. +type IPGroupsClientListResponse struct { + IPGroupListResult +} + +// IPGroupsClientUpdateGroupsResponse contains the response from method IPGroupsClient.UpdateGroups. +type IPGroupsClientUpdateGroupsResponse struct { + IPGroup +} + +// InboundNatRulesClientCreateOrUpdateResponse contains the response from method InboundNatRulesClient.BeginCreateOrUpdate. +type InboundNatRulesClientCreateOrUpdateResponse struct { + InboundNatRule +} + +// InboundNatRulesClientDeleteResponse contains the response from method InboundNatRulesClient.BeginDelete. +type InboundNatRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// InboundNatRulesClientGetResponse contains the response from method InboundNatRulesClient.Get. +type InboundNatRulesClientGetResponse struct { + InboundNatRule +} + +// InboundNatRulesClientListResponse contains the response from method InboundNatRulesClient.NewListPager. +type InboundNatRulesClientListResponse struct { + InboundNatRuleListResult +} + +// InboundSecurityRuleClientCreateOrUpdateResponse contains the response from method InboundSecurityRuleClient.BeginCreateOrUpdate. +type InboundSecurityRuleClientCreateOrUpdateResponse struct { + InboundSecurityRule +} + +// InterfaceIPConfigurationsClientGetResponse contains the response from method InterfaceIPConfigurationsClient.Get. +type InterfaceIPConfigurationsClientGetResponse struct { + InterfaceIPConfiguration +} + +// InterfaceIPConfigurationsClientListResponse contains the response from method InterfaceIPConfigurationsClient.NewListPager. +type InterfaceIPConfigurationsClientListResponse struct { + InterfaceIPConfigurationListResult +} + +// InterfaceLoadBalancersClientListResponse contains the response from method InterfaceLoadBalancersClient.NewListPager. +type InterfaceLoadBalancersClientListResponse struct { + InterfaceLoadBalancerListResult +} + +// InterfaceTapConfigurationsClientCreateOrUpdateResponse contains the response from method InterfaceTapConfigurationsClient.BeginCreateOrUpdate. +type InterfaceTapConfigurationsClientCreateOrUpdateResponse struct { + InterfaceTapConfiguration +} + +// InterfaceTapConfigurationsClientDeleteResponse contains the response from method InterfaceTapConfigurationsClient.BeginDelete. +type InterfaceTapConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// InterfaceTapConfigurationsClientGetResponse contains the response from method InterfaceTapConfigurationsClient.Get. +type InterfaceTapConfigurationsClientGetResponse struct { + InterfaceTapConfiguration +} + +// InterfaceTapConfigurationsClientListResponse contains the response from method InterfaceTapConfigurationsClient.NewListPager. +type InterfaceTapConfigurationsClientListResponse struct { + InterfaceTapConfigurationListResult +} + +// InterfacesClientCreateOrUpdateResponse contains the response from method InterfacesClient.BeginCreateOrUpdate. +type InterfacesClientCreateOrUpdateResponse struct { + Interface +} + +// InterfacesClientDeleteResponse contains the response from method InterfacesClient.BeginDelete. +type InterfacesClientDeleteResponse struct { + // placeholder for future response values +} + +// InterfacesClientGetCloudServiceNetworkInterfaceResponse contains the response from method InterfacesClient.GetCloudServiceNetworkInterface. +type InterfacesClientGetCloudServiceNetworkInterfaceResponse struct { + Interface +} + +// InterfacesClientGetEffectiveRouteTableResponse contains the response from method InterfacesClient.BeginGetEffectiveRouteTable. +type InterfacesClientGetEffectiveRouteTableResponse struct { + EffectiveRouteListResult +} + +// InterfacesClientGetResponse contains the response from method InterfacesClient.Get. +type InterfacesClientGetResponse struct { + Interface +} + +// InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse contains the response from method InterfacesClient.GetVirtualMachineScaleSetIPConfiguration. +type InterfacesClientGetVirtualMachineScaleSetIPConfigurationResponse struct { + InterfaceIPConfiguration +} + +// InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse contains the response from method InterfacesClient.GetVirtualMachineScaleSetNetworkInterface. +type InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse struct { + Interface +} + +// InterfacesClientListAllResponse contains the response from method InterfacesClient.NewListAllPager. +type InterfacesClientListAllResponse struct { + InterfaceListResult +} + +// InterfacesClientListCloudServiceNetworkInterfacesResponse contains the response from method InterfacesClient.NewListCloudServiceNetworkInterfacesPager. +type InterfacesClientListCloudServiceNetworkInterfacesResponse struct { + InterfaceListResult +} + +// InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse contains the response from method InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager. +type InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesResponse struct { + InterfaceListResult +} + +// InterfacesClientListEffectiveNetworkSecurityGroupsResponse contains the response from method InterfacesClient.BeginListEffectiveNetworkSecurityGroups. +type InterfacesClientListEffectiveNetworkSecurityGroupsResponse struct { + EffectiveNetworkSecurityGroupListResult +} + +// InterfacesClientListResponse contains the response from method InterfacesClient.NewListPager. +type InterfacesClientListResponse struct { + InterfaceListResult +} + +// InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager. +type InterfacesClientListVirtualMachineScaleSetIPConfigurationsResponse struct { + InterfaceIPConfigurationListResult +} + +// InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager. +type InterfacesClientListVirtualMachineScaleSetNetworkInterfacesResponse struct { + InterfaceListResult +} + +// InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse contains the response from method InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager. +type InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesResponse struct { + InterfaceListResult +} + +// InterfacesClientUpdateTagsResponse contains the response from method InterfacesClient.UpdateTags. +type InterfacesClientUpdateTagsResponse struct { + Interface +} + +// LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse contains the response from method LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate. +type LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse struct { + BackendAddressPool +} + +// LoadBalancerBackendAddressPoolsClientDeleteResponse contains the response from method LoadBalancerBackendAddressPoolsClient.BeginDelete. +type LoadBalancerBackendAddressPoolsClientDeleteResponse struct { + // placeholder for future response values +} + +// LoadBalancerBackendAddressPoolsClientGetResponse contains the response from method LoadBalancerBackendAddressPoolsClient.Get. +type LoadBalancerBackendAddressPoolsClientGetResponse struct { + BackendAddressPool +} + +// LoadBalancerBackendAddressPoolsClientListResponse contains the response from method LoadBalancerBackendAddressPoolsClient.NewListPager. +type LoadBalancerBackendAddressPoolsClientListResponse struct { + LoadBalancerBackendAddressPoolListResult +} + +// LoadBalancerFrontendIPConfigurationsClientGetResponse contains the response from method LoadBalancerFrontendIPConfigurationsClient.Get. +type LoadBalancerFrontendIPConfigurationsClientGetResponse struct { + FrontendIPConfiguration +} + +// LoadBalancerFrontendIPConfigurationsClientListResponse contains the response from method LoadBalancerFrontendIPConfigurationsClient.NewListPager. +type LoadBalancerFrontendIPConfigurationsClientListResponse struct { + LoadBalancerFrontendIPConfigurationListResult +} + +// LoadBalancerLoadBalancingRulesClientGetResponse contains the response from method LoadBalancerLoadBalancingRulesClient.Get. +type LoadBalancerLoadBalancingRulesClientGetResponse struct { + LoadBalancingRule +} + +// LoadBalancerLoadBalancingRulesClientListResponse contains the response from method LoadBalancerLoadBalancingRulesClient.NewListPager. +type LoadBalancerLoadBalancingRulesClientListResponse struct { + LoadBalancerLoadBalancingRuleListResult +} + +// LoadBalancerNetworkInterfacesClientListResponse contains the response from method LoadBalancerNetworkInterfacesClient.NewListPager. +type LoadBalancerNetworkInterfacesClientListResponse struct { + InterfaceListResult +} + +// LoadBalancerOutboundRulesClientGetResponse contains the response from method LoadBalancerOutboundRulesClient.Get. +type LoadBalancerOutboundRulesClientGetResponse struct { + OutboundRule +} + +// LoadBalancerOutboundRulesClientListResponse contains the response from method LoadBalancerOutboundRulesClient.NewListPager. +type LoadBalancerOutboundRulesClientListResponse struct { + LoadBalancerOutboundRuleListResult +} + +// LoadBalancerProbesClientGetResponse contains the response from method LoadBalancerProbesClient.Get. +type LoadBalancerProbesClientGetResponse struct { + Probe +} + +// LoadBalancerProbesClientListResponse contains the response from method LoadBalancerProbesClient.NewListPager. +type LoadBalancerProbesClientListResponse struct { + LoadBalancerProbeListResult +} + +// LoadBalancersClientCreateOrUpdateResponse contains the response from method LoadBalancersClient.BeginCreateOrUpdate. +type LoadBalancersClientCreateOrUpdateResponse struct { + LoadBalancer +} + +// LoadBalancersClientDeleteResponse contains the response from method LoadBalancersClient.BeginDelete. +type LoadBalancersClientDeleteResponse struct { + // placeholder for future response values +} + +// LoadBalancersClientGetResponse contains the response from method LoadBalancersClient.Get. +type LoadBalancersClientGetResponse struct { + LoadBalancer +} + +// LoadBalancersClientListAllResponse contains the response from method LoadBalancersClient.NewListAllPager. +type LoadBalancersClientListAllResponse struct { + LoadBalancerListResult +} + +// LoadBalancersClientListInboundNatRulePortMappingsResponse contains the response from method LoadBalancersClient.BeginListInboundNatRulePortMappings. +type LoadBalancersClientListInboundNatRulePortMappingsResponse struct { + BackendAddressInboundNatRulePortMappings +} + +// LoadBalancersClientListResponse contains the response from method LoadBalancersClient.NewListPager. +type LoadBalancersClientListResponse struct { + LoadBalancerListResult +} + +// LoadBalancersClientSwapPublicIPAddressesResponse contains the response from method LoadBalancersClient.BeginSwapPublicIPAddresses. +type LoadBalancersClientSwapPublicIPAddressesResponse struct { + // placeholder for future response values +} + +// LoadBalancersClientUpdateTagsResponse contains the response from method LoadBalancersClient.UpdateTags. +type LoadBalancersClientUpdateTagsResponse struct { + LoadBalancer +} + +// LocalNetworkGatewaysClientCreateOrUpdateResponse contains the response from method LocalNetworkGatewaysClient.BeginCreateOrUpdate. +type LocalNetworkGatewaysClientCreateOrUpdateResponse struct { + LocalNetworkGateway +} + +// LocalNetworkGatewaysClientDeleteResponse contains the response from method LocalNetworkGatewaysClient.BeginDelete. +type LocalNetworkGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// LocalNetworkGatewaysClientGetResponse contains the response from method LocalNetworkGatewaysClient.Get. +type LocalNetworkGatewaysClientGetResponse struct { + LocalNetworkGateway +} + +// LocalNetworkGatewaysClientListResponse contains the response from method LocalNetworkGatewaysClient.NewListPager. +type LocalNetworkGatewaysClientListResponse struct { + LocalNetworkGatewayListResult +} + +// LocalNetworkGatewaysClientUpdateTagsResponse contains the response from method LocalNetworkGatewaysClient.UpdateTags. +type LocalNetworkGatewaysClientUpdateTagsResponse struct { + LocalNetworkGateway +} + +// ManagementClientCheckDNSNameAvailabilityResponse contains the response from method ManagementClient.CheckDNSNameAvailability. +type ManagementClientCheckDNSNameAvailabilityResponse struct { + DNSNameAvailabilityResult +} + +// ManagementClientDeleteBastionShareableLinkResponse contains the response from method ManagementClient.BeginDeleteBastionShareableLink. +type ManagementClientDeleteBastionShareableLinkResponse struct { + // placeholder for future response values +} + +// ManagementClientDisconnectActiveSessionsResponse contains the response from method ManagementClient.NewDisconnectActiveSessionsPager. +type ManagementClientDisconnectActiveSessionsResponse struct { + BastionSessionDeleteResult +} + +// ManagementClientExpressRouteProviderPortResponse contains the response from method ManagementClient.ExpressRouteProviderPort. +type ManagementClientExpressRouteProviderPortResponse struct { + ExpressRouteProviderPort +} + +// ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse contains the response from method ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile. +type ManagementClientGeneratevirtualwanvpnserverconfigurationvpnprofileResponse struct { + VPNProfileResponse +} + +// ManagementClientGetActiveSessionsResponse contains the response from method ManagementClient.BeginGetActiveSessions. +type ManagementClientGetActiveSessionsResponse struct { + BastionActiveSessionListResult +} + +// ManagementClientGetBastionShareableLinkResponse contains the response from method ManagementClient.NewGetBastionShareableLinkPager. +type ManagementClientGetBastionShareableLinkResponse struct { + BastionShareableLinkListResult +} + +// ManagementClientListActiveConnectivityConfigurationsResponse contains the response from method ManagementClient.ListActiveConnectivityConfigurations. +type ManagementClientListActiveConnectivityConfigurationsResponse struct { + ActiveConnectivityConfigurationsListResult +} + +// ManagementClientListActiveSecurityAdminRulesResponse contains the response from method ManagementClient.ListActiveSecurityAdminRules. +type ManagementClientListActiveSecurityAdminRulesResponse struct { + ActiveSecurityAdminRulesListResult +} + +// ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse contains the response from method ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations. +type ManagementClientListNetworkManagerEffectiveConnectivityConfigurationsResponse struct { + ManagerEffectiveConnectivityConfigurationListResult +} + +// ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse contains the response from method ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules. +type ManagementClientListNetworkManagerEffectiveSecurityAdminRulesResponse struct { + ManagerEffectiveSecurityAdminRulesListResult +} + +// ManagementClientPutBastionShareableLinkResponse contains the response from method ManagementClient.BeginPutBastionShareableLink. +type ManagementClientPutBastionShareableLinkResponse struct { + BastionShareableLinkListResult +} + +// ManagementClientSupportedSecurityProvidersResponse contains the response from method ManagementClient.SupportedSecurityProviders. +type ManagementClientSupportedSecurityProvidersResponse struct { + VirtualWanSecurityProviders +} + +// ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate. +type ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateResponse struct { + ManagerConnection +} + +// ManagementGroupNetworkManagerConnectionsClientDeleteResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.Delete. +type ManagementGroupNetworkManagerConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagementGroupNetworkManagerConnectionsClientGetResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.Get. +type ManagementGroupNetworkManagerConnectionsClientGetResponse struct { + ManagerConnection +} + +// ManagementGroupNetworkManagerConnectionsClientListResponse contains the response from method ManagementGroupNetworkManagerConnectionsClient.NewListPager. +type ManagementGroupNetworkManagerConnectionsClientListResponse struct { + ManagerConnectionListResult +} + +// ManagerCommitsClientPostResponse contains the response from method ManagerCommitsClient.BeginPost. +type ManagerCommitsClientPostResponse struct { + ManagerCommit +} + +// ManagerDeploymentStatusClientListResponse contains the response from method ManagerDeploymentStatusClient.List. +type ManagerDeploymentStatusClientListResponse struct { + ManagerDeploymentStatusListResult +} + +// ManagersClientCreateOrUpdateResponse contains the response from method ManagersClient.CreateOrUpdate. +type ManagersClientCreateOrUpdateResponse struct { + Manager +} + +// ManagersClientDeleteResponse contains the response from method ManagersClient.BeginDelete. +type ManagersClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagersClientGetResponse contains the response from method ManagersClient.Get. +type ManagersClientGetResponse struct { + Manager +} + +// ManagersClientListBySubscriptionResponse contains the response from method ManagersClient.NewListBySubscriptionPager. +type ManagersClientListBySubscriptionResponse struct { + ManagerListResult +} + +// ManagersClientListResponse contains the response from method ManagersClient.NewListPager. +type ManagersClientListResponse struct { + ManagerListResult +} + +// ManagersClientPatchResponse contains the response from method ManagersClient.Patch. +type ManagersClientPatchResponse struct { + Manager +} + +// NatGatewaysClientCreateOrUpdateResponse contains the response from method NatGatewaysClient.BeginCreateOrUpdate. +type NatGatewaysClientCreateOrUpdateResponse struct { + NatGateway +} + +// NatGatewaysClientDeleteResponse contains the response from method NatGatewaysClient.BeginDelete. +type NatGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// NatGatewaysClientGetResponse contains the response from method NatGatewaysClient.Get. +type NatGatewaysClientGetResponse struct { + NatGateway +} + +// NatGatewaysClientListAllResponse contains the response from method NatGatewaysClient.NewListAllPager. +type NatGatewaysClientListAllResponse struct { + NatGatewayListResult +} + +// NatGatewaysClientListResponse contains the response from method NatGatewaysClient.NewListPager. +type NatGatewaysClientListResponse struct { + NatGatewayListResult +} + +// NatGatewaysClientUpdateTagsResponse contains the response from method NatGatewaysClient.UpdateTags. +type NatGatewaysClientUpdateTagsResponse struct { + NatGateway +} + +// NatRulesClientCreateOrUpdateResponse contains the response from method NatRulesClient.BeginCreateOrUpdate. +type NatRulesClientCreateOrUpdateResponse struct { + VPNGatewayNatRule +} + +// NatRulesClientDeleteResponse contains the response from method NatRulesClient.BeginDelete. +type NatRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// NatRulesClientGetResponse contains the response from method NatRulesClient.Get. +type NatRulesClientGetResponse struct { + VPNGatewayNatRule +} + +// NatRulesClientListByVPNGatewayResponse contains the response from method NatRulesClient.NewListByVPNGatewayPager. +type NatRulesClientListByVPNGatewayResponse struct { + ListVPNGatewayNatRulesResult +} + +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + OperationListResult +} + +// P2SVPNGatewaysClientCreateOrUpdateResponse contains the response from method P2SVPNGatewaysClient.BeginCreateOrUpdate. +type P2SVPNGatewaysClientCreateOrUpdateResponse struct { + P2SVPNGateway +} + +// P2SVPNGatewaysClientDeleteResponse contains the response from method P2SVPNGatewaysClient.BeginDelete. +type P2SVPNGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse contains the response from method P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections. +type P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse struct { + // placeholder for future response values +} + +// P2SVPNGatewaysClientGenerateVPNProfileResponse contains the response from method P2SVPNGatewaysClient.BeginGenerateVPNProfile. +type P2SVPNGatewaysClientGenerateVPNProfileResponse struct { + VPNProfileResponse +} + +// P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse contains the response from method P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed. +type P2SVPNGatewaysClientGetP2SVPNConnectionHealthDetailedResponse struct { + P2SVPNConnectionHealth +} + +// P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse contains the response from method P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth. +type P2SVPNGatewaysClientGetP2SVPNConnectionHealthResponse struct { + P2SVPNGateway +} + +// P2SVPNGatewaysClientGetResponse contains the response from method P2SVPNGatewaysClient.Get. +type P2SVPNGatewaysClientGetResponse struct { + P2SVPNGateway +} + +// P2SVPNGatewaysClientListByResourceGroupResponse contains the response from method P2SVPNGatewaysClient.NewListByResourceGroupPager. +type P2SVPNGatewaysClientListByResourceGroupResponse struct { + ListP2SVPNGatewaysResult +} + +// P2SVPNGatewaysClientListResponse contains the response from method P2SVPNGatewaysClient.NewListPager. +type P2SVPNGatewaysClientListResponse struct { + ListP2SVPNGatewaysResult +} + +// P2SVPNGatewaysClientResetResponse contains the response from method P2SVPNGatewaysClient.BeginReset. +type P2SVPNGatewaysClientResetResponse struct { + P2SVPNGateway +} + +// P2SVPNGatewaysClientUpdateTagsResponse contains the response from method P2SVPNGatewaysClient.BeginUpdateTags. +type P2SVPNGatewaysClientUpdateTagsResponse struct { + P2SVPNGateway +} + +// PacketCapturesClientCreateResponse contains the response from method PacketCapturesClient.BeginCreate. +type PacketCapturesClientCreateResponse struct { + PacketCaptureResult +} + +// PacketCapturesClientDeleteResponse contains the response from method PacketCapturesClient.BeginDelete. +type PacketCapturesClientDeleteResponse struct { + // placeholder for future response values +} + +// PacketCapturesClientGetResponse contains the response from method PacketCapturesClient.Get. +type PacketCapturesClientGetResponse struct { + PacketCaptureResult +} + +// PacketCapturesClientGetStatusResponse contains the response from method PacketCapturesClient.BeginGetStatus. +type PacketCapturesClientGetStatusResponse struct { + PacketCaptureQueryStatusResult +} + +// PacketCapturesClientListResponse contains the response from method PacketCapturesClient.NewListPager. +type PacketCapturesClientListResponse struct { + PacketCaptureListResult +} + +// PacketCapturesClientStopResponse contains the response from method PacketCapturesClient.BeginStop. +type PacketCapturesClientStopResponse struct { + // placeholder for future response values +} + +// PeerExpressRouteCircuitConnectionsClientGetResponse contains the response from method PeerExpressRouteCircuitConnectionsClient.Get. +type PeerExpressRouteCircuitConnectionsClientGetResponse struct { + PeerExpressRouteCircuitConnection +} + +// PeerExpressRouteCircuitConnectionsClientListResponse contains the response from method PeerExpressRouteCircuitConnectionsClient.NewListPager. +type PeerExpressRouteCircuitConnectionsClientListResponse struct { + PeerExpressRouteCircuitConnectionListResult +} + +// PrivateDNSZoneGroupsClientCreateOrUpdateResponse contains the response from method PrivateDNSZoneGroupsClient.BeginCreateOrUpdate. +type PrivateDNSZoneGroupsClientCreateOrUpdateResponse struct { + PrivateDNSZoneGroup +} + +// PrivateDNSZoneGroupsClientDeleteResponse contains the response from method PrivateDNSZoneGroupsClient.BeginDelete. +type PrivateDNSZoneGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateDNSZoneGroupsClientGetResponse contains the response from method PrivateDNSZoneGroupsClient.Get. +type PrivateDNSZoneGroupsClientGetResponse struct { + PrivateDNSZoneGroup +} + +// PrivateDNSZoneGroupsClientListResponse contains the response from method PrivateDNSZoneGroupsClient.NewListPager. +type PrivateDNSZoneGroupsClientListResponse struct { + PrivateDNSZoneGroupListResult +} + +// PrivateEndpointsClientCreateOrUpdateResponse contains the response from method PrivateEndpointsClient.BeginCreateOrUpdate. +type PrivateEndpointsClientCreateOrUpdateResponse struct { + PrivateEndpoint +} + +// PrivateEndpointsClientDeleteResponse contains the response from method PrivateEndpointsClient.BeginDelete. +type PrivateEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointsClientGetResponse contains the response from method PrivateEndpointsClient.Get. +type PrivateEndpointsClientGetResponse struct { + PrivateEndpoint +} + +// PrivateEndpointsClientListBySubscriptionResponse contains the response from method PrivateEndpointsClient.NewListBySubscriptionPager. +type PrivateEndpointsClientListBySubscriptionResponse struct { + PrivateEndpointListResult +} + +// PrivateEndpointsClientListResponse contains the response from method PrivateEndpointsClient.NewListPager. +type PrivateEndpointsClientListResponse struct { + PrivateEndpointListResult +} + +// PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse contains the response from method PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup. +type PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityByResourceGroupResponse struct { + PrivateLinkServiceVisibility +} + +// PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse contains the response from method PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility. +type PrivateLinkServicesClientCheckPrivateLinkServiceVisibilityResponse struct { + PrivateLinkServiceVisibility +} + +// PrivateLinkServicesClientCreateOrUpdateResponse contains the response from method PrivateLinkServicesClient.BeginCreateOrUpdate. +type PrivateLinkServicesClientCreateOrUpdateResponse struct { + PrivateLinkService +} + +// PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection. +type PrivateLinkServicesClientDeletePrivateEndpointConnectionResponse struct { + // placeholder for future response values +} + +// PrivateLinkServicesClientDeleteResponse contains the response from method PrivateLinkServicesClient.BeginDelete. +type PrivateLinkServicesClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateLinkServicesClientGetPrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.GetPrivateEndpointConnection. +type PrivateLinkServicesClientGetPrivateEndpointConnectionResponse struct { + PrivateEndpointConnection +} + +// PrivateLinkServicesClientGetResponse contains the response from method PrivateLinkServicesClient.Get. +type PrivateLinkServicesClientGetResponse struct { + PrivateLinkService +} + +// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse contains the response from method PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager. +type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupResponse struct { + AutoApprovedPrivateLinkServicesResult +} + +// PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse contains the response from method PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager. +type PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesResponse struct { + AutoApprovedPrivateLinkServicesResult +} + +// PrivateLinkServicesClientListBySubscriptionResponse contains the response from method PrivateLinkServicesClient.NewListBySubscriptionPager. +type PrivateLinkServicesClientListBySubscriptionResponse struct { + PrivateLinkServiceListResult +} + +// PrivateLinkServicesClientListPrivateEndpointConnectionsResponse contains the response from method PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager. +type PrivateLinkServicesClientListPrivateEndpointConnectionsResponse struct { + PrivateEndpointConnectionListResult +} + +// PrivateLinkServicesClientListResponse contains the response from method PrivateLinkServicesClient.NewListPager. +type PrivateLinkServicesClientListResponse struct { + PrivateLinkServiceListResult +} + +// PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse contains the response from method PrivateLinkServicesClient.UpdatePrivateEndpointConnection. +type PrivateLinkServicesClientUpdatePrivateEndpointConnectionResponse struct { + PrivateEndpointConnection +} + +// ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.CreateOrUpdate. +type ProfilesClientCreateOrUpdateResponse struct { + Profile +} + +// ProfilesClientDeleteResponse contains the response from method ProfilesClient.BeginDelete. +type ProfilesClientDeleteResponse struct { + // placeholder for future response values +} + +// ProfilesClientGetResponse contains the response from method ProfilesClient.Get. +type ProfilesClientGetResponse struct { + Profile +} + +// ProfilesClientListAllResponse contains the response from method ProfilesClient.NewListAllPager. +type ProfilesClientListAllResponse struct { + ProfileListResult +} + +// ProfilesClientListResponse contains the response from method ProfilesClient.NewListPager. +type ProfilesClientListResponse struct { + ProfileListResult +} + +// ProfilesClientUpdateTagsResponse contains the response from method ProfilesClient.UpdateTags. +type ProfilesClientUpdateTagsResponse struct { + Profile +} + +// PublicIPAddressesClientCreateOrUpdateResponse contains the response from method PublicIPAddressesClient.BeginCreateOrUpdate. +type PublicIPAddressesClientCreateOrUpdateResponse struct { + PublicIPAddress +} + +// PublicIPAddressesClientDdosProtectionStatusResponse contains the response from method PublicIPAddressesClient.BeginDdosProtectionStatus. +type PublicIPAddressesClientDdosProtectionStatusResponse struct { + PublicIPDdosProtectionStatusResult +} + +// PublicIPAddressesClientDeleteResponse contains the response from method PublicIPAddressesClient.BeginDelete. +type PublicIPAddressesClientDeleteResponse struct { + // placeholder for future response values +} + +// PublicIPAddressesClientGetCloudServicePublicIPAddressResponse contains the response from method PublicIPAddressesClient.GetCloudServicePublicIPAddress. +type PublicIPAddressesClientGetCloudServicePublicIPAddressResponse struct { + PublicIPAddress +} + +// PublicIPAddressesClientGetResponse contains the response from method PublicIPAddressesClient.Get. +type PublicIPAddressesClientGetResponse struct { + PublicIPAddress +} + +// PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse contains the response from method PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress. +type PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse struct { + PublicIPAddress +} + +// PublicIPAddressesClientListAllResponse contains the response from method PublicIPAddressesClient.NewListAllPager. +type PublicIPAddressesClientListAllResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientListCloudServicePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager. +type PublicIPAddressesClientListCloudServicePublicIPAddressesResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager. +type PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientListResponse contains the response from method PublicIPAddressesClient.NewListPager. +type PublicIPAddressesClientListResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager. +type PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse contains the response from method PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager. +type PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesResponse struct { + PublicIPAddressListResult +} + +// PublicIPAddressesClientUpdateTagsResponse contains the response from method PublicIPAddressesClient.UpdateTags. +type PublicIPAddressesClientUpdateTagsResponse struct { + PublicIPAddress +} + +// PublicIPPrefixesClientCreateOrUpdateResponse contains the response from method PublicIPPrefixesClient.BeginCreateOrUpdate. +type PublicIPPrefixesClientCreateOrUpdateResponse struct { + PublicIPPrefix +} + +// PublicIPPrefixesClientDeleteResponse contains the response from method PublicIPPrefixesClient.BeginDelete. +type PublicIPPrefixesClientDeleteResponse struct { + // placeholder for future response values +} + +// PublicIPPrefixesClientGetResponse contains the response from method PublicIPPrefixesClient.Get. +type PublicIPPrefixesClientGetResponse struct { + PublicIPPrefix +} + +// PublicIPPrefixesClientListAllResponse contains the response from method PublicIPPrefixesClient.NewListAllPager. +type PublicIPPrefixesClientListAllResponse struct { + PublicIPPrefixListResult +} + +// PublicIPPrefixesClientListResponse contains the response from method PublicIPPrefixesClient.NewListPager. +type PublicIPPrefixesClientListResponse struct { + PublicIPPrefixListResult +} + +// PublicIPPrefixesClientUpdateTagsResponse contains the response from method PublicIPPrefixesClient.UpdateTags. +type PublicIPPrefixesClientUpdateTagsResponse struct { + PublicIPPrefix +} + +// ResourceNavigationLinksClientListResponse contains the response from method ResourceNavigationLinksClient.List. +type ResourceNavigationLinksClientListResponse struct { + ResourceNavigationLinksListResult +} + +// RouteFilterRulesClientCreateOrUpdateResponse contains the response from method RouteFilterRulesClient.BeginCreateOrUpdate. +type RouteFilterRulesClientCreateOrUpdateResponse struct { + RouteFilterRule +} + +// RouteFilterRulesClientDeleteResponse contains the response from method RouteFilterRulesClient.BeginDelete. +type RouteFilterRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// RouteFilterRulesClientGetResponse contains the response from method RouteFilterRulesClient.Get. +type RouteFilterRulesClientGetResponse struct { + RouteFilterRule +} + +// RouteFilterRulesClientListByRouteFilterResponse contains the response from method RouteFilterRulesClient.NewListByRouteFilterPager. +type RouteFilterRulesClientListByRouteFilterResponse struct { + RouteFilterRuleListResult +} + +// RouteFiltersClientCreateOrUpdateResponse contains the response from method RouteFiltersClient.BeginCreateOrUpdate. +type RouteFiltersClientCreateOrUpdateResponse struct { + RouteFilter +} + +// RouteFiltersClientDeleteResponse contains the response from method RouteFiltersClient.BeginDelete. +type RouteFiltersClientDeleteResponse struct { + // placeholder for future response values +} + +// RouteFiltersClientGetResponse contains the response from method RouteFiltersClient.Get. +type RouteFiltersClientGetResponse struct { + RouteFilter +} + +// RouteFiltersClientListByResourceGroupResponse contains the response from method RouteFiltersClient.NewListByResourceGroupPager. +type RouteFiltersClientListByResourceGroupResponse struct { + RouteFilterListResult +} + +// RouteFiltersClientListResponse contains the response from method RouteFiltersClient.NewListPager. +type RouteFiltersClientListResponse struct { + RouteFilterListResult +} + +// RouteFiltersClientUpdateTagsResponse contains the response from method RouteFiltersClient.UpdateTags. +type RouteFiltersClientUpdateTagsResponse struct { + RouteFilter +} + +// RouteMapsClientCreateOrUpdateResponse contains the response from method RouteMapsClient.BeginCreateOrUpdate. +type RouteMapsClientCreateOrUpdateResponse struct { + RouteMap +} + +// RouteMapsClientDeleteResponse contains the response from method RouteMapsClient.BeginDelete. +type RouteMapsClientDeleteResponse struct { + // placeholder for future response values +} + +// RouteMapsClientGetResponse contains the response from method RouteMapsClient.Get. +type RouteMapsClientGetResponse struct { + RouteMap +} + +// RouteMapsClientListResponse contains the response from method RouteMapsClient.NewListPager. +type RouteMapsClientListResponse struct { + ListRouteMapsResult +} + +// RouteTablesClientCreateOrUpdateResponse contains the response from method RouteTablesClient.BeginCreateOrUpdate. +type RouteTablesClientCreateOrUpdateResponse struct { + RouteTable +} + +// RouteTablesClientDeleteResponse contains the response from method RouteTablesClient.BeginDelete. +type RouteTablesClientDeleteResponse struct { + // placeholder for future response values +} + +// RouteTablesClientGetResponse contains the response from method RouteTablesClient.Get. +type RouteTablesClientGetResponse struct { + RouteTable +} + +// RouteTablesClientListAllResponse contains the response from method RouteTablesClient.NewListAllPager. +type RouteTablesClientListAllResponse struct { + RouteTableListResult +} + +// RouteTablesClientListResponse contains the response from method RouteTablesClient.NewListPager. +type RouteTablesClientListResponse struct { + RouteTableListResult +} + +// RouteTablesClientUpdateTagsResponse contains the response from method RouteTablesClient.UpdateTags. +type RouteTablesClientUpdateTagsResponse struct { + RouteTable +} + +// RoutesClientCreateOrUpdateResponse contains the response from method RoutesClient.BeginCreateOrUpdate. +type RoutesClientCreateOrUpdateResponse struct { + Route +} + +// RoutesClientDeleteResponse contains the response from method RoutesClient.BeginDelete. +type RoutesClientDeleteResponse struct { + // placeholder for future response values +} + +// RoutesClientGetResponse contains the response from method RoutesClient.Get. +type RoutesClientGetResponse struct { + Route +} + +// RoutesClientListResponse contains the response from method RoutesClient.NewListPager. +type RoutesClientListResponse struct { + RouteListResult +} + +// RoutingIntentClientCreateOrUpdateResponse contains the response from method RoutingIntentClient.BeginCreateOrUpdate. +type RoutingIntentClientCreateOrUpdateResponse struct { + RoutingIntent +} + +// RoutingIntentClientDeleteResponse contains the response from method RoutingIntentClient.BeginDelete. +type RoutingIntentClientDeleteResponse struct { + // placeholder for future response values +} + +// RoutingIntentClientGetResponse contains the response from method RoutingIntentClient.Get. +type RoutingIntentClientGetResponse struct { + RoutingIntent +} + +// RoutingIntentClientListResponse contains the response from method RoutingIntentClient.NewListPager. +type RoutingIntentClientListResponse struct { + ListRoutingIntentResult +} + +// ScopeConnectionsClientCreateOrUpdateResponse contains the response from method ScopeConnectionsClient.CreateOrUpdate. +type ScopeConnectionsClientCreateOrUpdateResponse struct { + ScopeConnection +} + +// ScopeConnectionsClientDeleteResponse contains the response from method ScopeConnectionsClient.Delete. +type ScopeConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ScopeConnectionsClientGetResponse contains the response from method ScopeConnectionsClient.Get. +type ScopeConnectionsClientGetResponse struct { + ScopeConnection +} + +// ScopeConnectionsClientListResponse contains the response from method ScopeConnectionsClient.NewListPager. +type ScopeConnectionsClientListResponse struct { + ScopeConnectionListResult +} + +// SecurityAdminConfigurationsClientCreateOrUpdateResponse contains the response from method SecurityAdminConfigurationsClient.CreateOrUpdate. +type SecurityAdminConfigurationsClientCreateOrUpdateResponse struct { + SecurityAdminConfiguration +} + +// SecurityAdminConfigurationsClientDeleteResponse contains the response from method SecurityAdminConfigurationsClient.BeginDelete. +type SecurityAdminConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityAdminConfigurationsClientGetResponse contains the response from method SecurityAdminConfigurationsClient.Get. +type SecurityAdminConfigurationsClientGetResponse struct { + SecurityAdminConfiguration +} + +// SecurityAdminConfigurationsClientListResponse contains the response from method SecurityAdminConfigurationsClient.NewListPager. +type SecurityAdminConfigurationsClientListResponse struct { + SecurityAdminConfigurationListResult +} + +// SecurityGroupsClientCreateOrUpdateResponse contains the response from method SecurityGroupsClient.BeginCreateOrUpdate. +type SecurityGroupsClientCreateOrUpdateResponse struct { + SecurityGroup +} + +// SecurityGroupsClientDeleteResponse contains the response from method SecurityGroupsClient.BeginDelete. +type SecurityGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityGroupsClientGetResponse contains the response from method SecurityGroupsClient.Get. +type SecurityGroupsClientGetResponse struct { + SecurityGroup +} + +// SecurityGroupsClientListAllResponse contains the response from method SecurityGroupsClient.NewListAllPager. +type SecurityGroupsClientListAllResponse struct { + SecurityGroupListResult +} + +// SecurityGroupsClientListResponse contains the response from method SecurityGroupsClient.NewListPager. +type SecurityGroupsClientListResponse struct { + SecurityGroupListResult +} + +// SecurityGroupsClientUpdateTagsResponse contains the response from method SecurityGroupsClient.UpdateTags. +type SecurityGroupsClientUpdateTagsResponse struct { + SecurityGroup +} + +// SecurityPartnerProvidersClientCreateOrUpdateResponse contains the response from method SecurityPartnerProvidersClient.BeginCreateOrUpdate. +type SecurityPartnerProvidersClientCreateOrUpdateResponse struct { + SecurityPartnerProvider +} + +// SecurityPartnerProvidersClientDeleteResponse contains the response from method SecurityPartnerProvidersClient.BeginDelete. +type SecurityPartnerProvidersClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPartnerProvidersClientGetResponse contains the response from method SecurityPartnerProvidersClient.Get. +type SecurityPartnerProvidersClientGetResponse struct { + SecurityPartnerProvider +} + +// SecurityPartnerProvidersClientListByResourceGroupResponse contains the response from method SecurityPartnerProvidersClient.NewListByResourceGroupPager. +type SecurityPartnerProvidersClientListByResourceGroupResponse struct { + SecurityPartnerProviderListResult +} + +// SecurityPartnerProvidersClientListResponse contains the response from method SecurityPartnerProvidersClient.NewListPager. +type SecurityPartnerProvidersClientListResponse struct { + SecurityPartnerProviderListResult +} + +// SecurityPartnerProvidersClientUpdateTagsResponse contains the response from method SecurityPartnerProvidersClient.UpdateTags. +type SecurityPartnerProvidersClientUpdateTagsResponse struct { + SecurityPartnerProvider +} + +// SecurityRulesClientCreateOrUpdateResponse contains the response from method SecurityRulesClient.BeginCreateOrUpdate. +type SecurityRulesClientCreateOrUpdateResponse struct { + SecurityRule +} + +// SecurityRulesClientDeleteResponse contains the response from method SecurityRulesClient.BeginDelete. +type SecurityRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityRulesClientGetResponse contains the response from method SecurityRulesClient.Get. +type SecurityRulesClientGetResponse struct { + SecurityRule +} + +// SecurityRulesClientListResponse contains the response from method SecurityRulesClient.NewListPager. +type SecurityRulesClientListResponse struct { + SecurityRuleListResult +} + +// ServiceAssociationLinksClientListResponse contains the response from method ServiceAssociationLinksClient.List. +type ServiceAssociationLinksClientListResponse struct { + ServiceAssociationLinksListResult +} + +// ServiceEndpointPoliciesClientCreateOrUpdateResponse contains the response from method ServiceEndpointPoliciesClient.BeginCreateOrUpdate. +type ServiceEndpointPoliciesClientCreateOrUpdateResponse struct { + ServiceEndpointPolicy +} + +// ServiceEndpointPoliciesClientDeleteResponse contains the response from method ServiceEndpointPoliciesClient.BeginDelete. +type ServiceEndpointPoliciesClientDeleteResponse struct { + // placeholder for future response values +} + +// ServiceEndpointPoliciesClientGetResponse contains the response from method ServiceEndpointPoliciesClient.Get. +type ServiceEndpointPoliciesClientGetResponse struct { + ServiceEndpointPolicy +} + +// ServiceEndpointPoliciesClientListByResourceGroupResponse contains the response from method ServiceEndpointPoliciesClient.NewListByResourceGroupPager. +type ServiceEndpointPoliciesClientListByResourceGroupResponse struct { + ServiceEndpointPolicyListResult +} + +// ServiceEndpointPoliciesClientListResponse contains the response from method ServiceEndpointPoliciesClient.NewListPager. +type ServiceEndpointPoliciesClientListResponse struct { + ServiceEndpointPolicyListResult +} + +// ServiceEndpointPoliciesClientUpdateTagsResponse contains the response from method ServiceEndpointPoliciesClient.UpdateTags. +type ServiceEndpointPoliciesClientUpdateTagsResponse struct { + ServiceEndpointPolicy +} + +// ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate. +type ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse struct { + ServiceEndpointPolicyDefinition +} + +// ServiceEndpointPolicyDefinitionsClientDeleteResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.BeginDelete. +type ServiceEndpointPolicyDefinitionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ServiceEndpointPolicyDefinitionsClientGetResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.Get. +type ServiceEndpointPolicyDefinitionsClientGetResponse struct { + ServiceEndpointPolicyDefinition +} + +// ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse contains the response from method ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager. +type ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse struct { + ServiceEndpointPolicyDefinitionListResult +} + +// ServiceTagInformationClientListResponse contains the response from method ServiceTagInformationClient.NewListPager. +type ServiceTagInformationClientListResponse struct { + ServiceTagInformationListResult +} + +// ServiceTagsClientListResponse contains the response from method ServiceTagsClient.List. +type ServiceTagsClientListResponse struct { + ServiceTagsListResult +} + +// StaticMembersClientCreateOrUpdateResponse contains the response from method StaticMembersClient.CreateOrUpdate. +type StaticMembersClientCreateOrUpdateResponse struct { + StaticMember +} + +// StaticMembersClientDeleteResponse contains the response from method StaticMembersClient.Delete. +type StaticMembersClientDeleteResponse struct { + // placeholder for future response values +} + +// StaticMembersClientGetResponse contains the response from method StaticMembersClient.Get. +type StaticMembersClientGetResponse struct { + StaticMember +} + +// StaticMembersClientListResponse contains the response from method StaticMembersClient.NewListPager. +type StaticMembersClientListResponse struct { + StaticMemberListResult +} + +// SubnetsClientCreateOrUpdateResponse contains the response from method SubnetsClient.BeginCreateOrUpdate. +type SubnetsClientCreateOrUpdateResponse struct { + Subnet +} + +// SubnetsClientDeleteResponse contains the response from method SubnetsClient.BeginDelete. +type SubnetsClientDeleteResponse struct { + // placeholder for future response values +} + +// SubnetsClientGetResponse contains the response from method SubnetsClient.Get. +type SubnetsClientGetResponse struct { + Subnet +} + +// SubnetsClientListResponse contains the response from method SubnetsClient.NewListPager. +type SubnetsClientListResponse struct { + SubnetListResult +} + +// SubnetsClientPrepareNetworkPoliciesResponse contains the response from method SubnetsClient.BeginPrepareNetworkPolicies. +type SubnetsClientPrepareNetworkPoliciesResponse struct { + // placeholder for future response values +} + +// SubnetsClientUnprepareNetworkPoliciesResponse contains the response from method SubnetsClient.BeginUnprepareNetworkPolicies. +type SubnetsClientUnprepareNetworkPoliciesResponse struct { + // placeholder for future response values +} + +// SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate. +type SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse struct { + ManagerConnection +} + +// SubscriptionNetworkManagerConnectionsClientDeleteResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.Delete. +type SubscriptionNetworkManagerConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// SubscriptionNetworkManagerConnectionsClientGetResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.Get. +type SubscriptionNetworkManagerConnectionsClientGetResponse struct { + ManagerConnection +} + +// SubscriptionNetworkManagerConnectionsClientListResponse contains the response from method SubscriptionNetworkManagerConnectionsClient.NewListPager. +type SubscriptionNetworkManagerConnectionsClientListResponse struct { + ManagerConnectionListResult +} + +// UsagesClientListResponse contains the response from method UsagesClient.NewListPager. +type UsagesClientListResponse struct { + UsagesListResult +} + +// VPNConnectionsClientCreateOrUpdateResponse contains the response from method VPNConnectionsClient.BeginCreateOrUpdate. +type VPNConnectionsClientCreateOrUpdateResponse struct { + VPNConnection +} + +// VPNConnectionsClientDeleteResponse contains the response from method VPNConnectionsClient.BeginDelete. +type VPNConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// VPNConnectionsClientGetResponse contains the response from method VPNConnectionsClient.Get. +type VPNConnectionsClientGetResponse struct { + VPNConnection +} + +// VPNConnectionsClientListByVPNGatewayResponse contains the response from method VPNConnectionsClient.NewListByVPNGatewayPager. +type VPNConnectionsClientListByVPNGatewayResponse struct { + ListVPNConnectionsResult +} + +// VPNConnectionsClientStartPacketCaptureResponse contains the response from method VPNConnectionsClient.BeginStartPacketCapture. +type VPNConnectionsClientStartPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStartPacketCaptureResponse. +func (v *VPNConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VPNConnectionsClientStopPacketCaptureResponse contains the response from method VPNConnectionsClient.BeginStopPacketCapture. +type VPNConnectionsClientStopPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStopPacketCaptureResponse. +func (v *VPNConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VPNGatewaysClientCreateOrUpdateResponse contains the response from method VPNGatewaysClient.BeginCreateOrUpdate. +type VPNGatewaysClientCreateOrUpdateResponse struct { + VPNGateway +} + +// VPNGatewaysClientDeleteResponse contains the response from method VPNGatewaysClient.BeginDelete. +type VPNGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// VPNGatewaysClientGetResponse contains the response from method VPNGatewaysClient.Get. +type VPNGatewaysClientGetResponse struct { + VPNGateway +} + +// VPNGatewaysClientListByResourceGroupResponse contains the response from method VPNGatewaysClient.NewListByResourceGroupPager. +type VPNGatewaysClientListByResourceGroupResponse struct { + ListVPNGatewaysResult +} + +// VPNGatewaysClientListResponse contains the response from method VPNGatewaysClient.NewListPager. +type VPNGatewaysClientListResponse struct { + ListVPNGatewaysResult +} + +// VPNGatewaysClientResetResponse contains the response from method VPNGatewaysClient.BeginReset. +type VPNGatewaysClientResetResponse struct { + VPNGateway +} + +// VPNGatewaysClientStartPacketCaptureResponse contains the response from method VPNGatewaysClient.BeginStartPacketCapture. +type VPNGatewaysClientStartPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStartPacketCaptureResponse. +func (v *VPNGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VPNGatewaysClientStopPacketCaptureResponse contains the response from method VPNGatewaysClient.BeginStopPacketCapture. +type VPNGatewaysClientStopPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStopPacketCaptureResponse. +func (v *VPNGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VPNGatewaysClientUpdateTagsResponse contains the response from method VPNGatewaysClient.BeginUpdateTags. +type VPNGatewaysClientUpdateTagsResponse struct { + VPNGateway +} + +// VPNLinkConnectionsClientGetIkeSasResponse contains the response from method VPNLinkConnectionsClient.BeginGetIkeSas. +type VPNLinkConnectionsClientGetIkeSasResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkConnectionsClientGetIkeSasResponse. +func (v *VPNLinkConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VPNLinkConnectionsClientListByVPNConnectionResponse contains the response from method VPNLinkConnectionsClient.NewListByVPNConnectionPager. +type VPNLinkConnectionsClientListByVPNConnectionResponse struct { + ListVPNSiteLinkConnectionsResult +} + +// VPNLinkConnectionsClientResetConnectionResponse contains the response from method VPNLinkConnectionsClient.BeginResetConnection. +type VPNLinkConnectionsClientResetConnectionResponse struct { + // placeholder for future response values +} + +// VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse contains the response from method VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList. +type VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse struct { + VPNServerConfigurationsResponse +} + +// VPNServerConfigurationsClientCreateOrUpdateResponse contains the response from method VPNServerConfigurationsClient.BeginCreateOrUpdate. +type VPNServerConfigurationsClientCreateOrUpdateResponse struct { + VPNServerConfiguration +} + +// VPNServerConfigurationsClientDeleteResponse contains the response from method VPNServerConfigurationsClient.BeginDelete. +type VPNServerConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// VPNServerConfigurationsClientGetResponse contains the response from method VPNServerConfigurationsClient.Get. +type VPNServerConfigurationsClientGetResponse struct { + VPNServerConfiguration +} + +// VPNServerConfigurationsClientListByResourceGroupResponse contains the response from method VPNServerConfigurationsClient.NewListByResourceGroupPager. +type VPNServerConfigurationsClientListByResourceGroupResponse struct { + ListVPNServerConfigurationsResult +} + +// VPNServerConfigurationsClientListResponse contains the response from method VPNServerConfigurationsClient.NewListPager. +type VPNServerConfigurationsClientListResponse struct { + ListVPNServerConfigurationsResult +} + +// VPNServerConfigurationsClientUpdateTagsResponse contains the response from method VPNServerConfigurationsClient.UpdateTags. +type VPNServerConfigurationsClientUpdateTagsResponse struct { + VPNServerConfiguration +} + +// VPNSiteLinkConnectionsClientGetResponse contains the response from method VPNSiteLinkConnectionsClient.Get. +type VPNSiteLinkConnectionsClientGetResponse struct { + VPNSiteLinkConnection +} + +// VPNSiteLinksClientGetResponse contains the response from method VPNSiteLinksClient.Get. +type VPNSiteLinksClientGetResponse struct { + VPNSiteLink +} + +// VPNSiteLinksClientListByVPNSiteResponse contains the response from method VPNSiteLinksClient.NewListByVPNSitePager. +type VPNSiteLinksClientListByVPNSiteResponse struct { + ListVPNSiteLinksResult +} + +// VPNSitesClientCreateOrUpdateResponse contains the response from method VPNSitesClient.BeginCreateOrUpdate. +type VPNSitesClientCreateOrUpdateResponse struct { + VPNSite +} + +// VPNSitesClientDeleteResponse contains the response from method VPNSitesClient.BeginDelete. +type VPNSitesClientDeleteResponse struct { + // placeholder for future response values +} + +// VPNSitesClientGetResponse contains the response from method VPNSitesClient.Get. +type VPNSitesClientGetResponse struct { + VPNSite +} + +// VPNSitesClientListByResourceGroupResponse contains the response from method VPNSitesClient.NewListByResourceGroupPager. +type VPNSitesClientListByResourceGroupResponse struct { + ListVPNSitesResult +} + +// VPNSitesClientListResponse contains the response from method VPNSitesClient.NewListPager. +type VPNSitesClientListResponse struct { + ListVPNSitesResult +} + +// VPNSitesClientUpdateTagsResponse contains the response from method VPNSitesClient.UpdateTags. +type VPNSitesClientUpdateTagsResponse struct { + VPNSite +} + +// VPNSitesConfigurationClientDownloadResponse contains the response from method VPNSitesConfigurationClient.BeginDownload. +type VPNSitesConfigurationClientDownloadResponse struct { + // placeholder for future response values +} + +// VipSwapClientCreateResponse contains the response from method VipSwapClient.BeginCreate. +type VipSwapClientCreateResponse struct { + // placeholder for future response values +} + +// VipSwapClientGetResponse contains the response from method VipSwapClient.Get. +type VipSwapClientGetResponse struct { + SwapResource +} + +// VipSwapClientListResponse contains the response from method VipSwapClient.List. +type VipSwapClientListResponse struct { + SwapResourceListResult +} + +// VirtualApplianceSKUsClientGetResponse contains the response from method VirtualApplianceSKUsClient.Get. +type VirtualApplianceSKUsClientGetResponse struct { + VirtualApplianceSKU +} + +// VirtualApplianceSKUsClientListResponse contains the response from method VirtualApplianceSKUsClient.NewListPager. +type VirtualApplianceSKUsClientListResponse struct { + VirtualApplianceSKUListResult +} + +// VirtualApplianceSitesClientCreateOrUpdateResponse contains the response from method VirtualApplianceSitesClient.BeginCreateOrUpdate. +type VirtualApplianceSitesClientCreateOrUpdateResponse struct { + VirtualApplianceSite +} + +// VirtualApplianceSitesClientDeleteResponse contains the response from method VirtualApplianceSitesClient.BeginDelete. +type VirtualApplianceSitesClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualApplianceSitesClientGetResponse contains the response from method VirtualApplianceSitesClient.Get. +type VirtualApplianceSitesClientGetResponse struct { + VirtualApplianceSite +} + +// VirtualApplianceSitesClientListResponse contains the response from method VirtualApplianceSitesClient.NewListPager. +type VirtualApplianceSitesClientListResponse struct { + VirtualApplianceSiteListResult +} + +// VirtualAppliancesClientCreateOrUpdateResponse contains the response from method VirtualAppliancesClient.BeginCreateOrUpdate. +type VirtualAppliancesClientCreateOrUpdateResponse struct { + VirtualAppliance +} + +// VirtualAppliancesClientDeleteResponse contains the response from method VirtualAppliancesClient.BeginDelete. +type VirtualAppliancesClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualAppliancesClientGetResponse contains the response from method VirtualAppliancesClient.Get. +type VirtualAppliancesClientGetResponse struct { + VirtualAppliance +} + +// VirtualAppliancesClientListByResourceGroupResponse contains the response from method VirtualAppliancesClient.NewListByResourceGroupPager. +type VirtualAppliancesClientListByResourceGroupResponse struct { + VirtualApplianceListResult +} + +// VirtualAppliancesClientListResponse contains the response from method VirtualAppliancesClient.NewListPager. +type VirtualAppliancesClientListResponse struct { + VirtualApplianceListResult +} + +// VirtualAppliancesClientUpdateTagsResponse contains the response from method VirtualAppliancesClient.UpdateTags. +type VirtualAppliancesClientUpdateTagsResponse struct { + VirtualAppliance +} + +// VirtualHubBgpConnectionClientCreateOrUpdateResponse contains the response from method VirtualHubBgpConnectionClient.BeginCreateOrUpdate. +type VirtualHubBgpConnectionClientCreateOrUpdateResponse struct { + BgpConnection +} + +// VirtualHubBgpConnectionClientDeleteResponse contains the response from method VirtualHubBgpConnectionClient.BeginDelete. +type VirtualHubBgpConnectionClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualHubBgpConnectionClientGetResponse contains the response from method VirtualHubBgpConnectionClient.Get. +type VirtualHubBgpConnectionClientGetResponse struct { + BgpConnection +} + +// VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes. +type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse struct { + PeerRouteList +} + +// VirtualHubBgpConnectionsClientListLearnedRoutesResponse contains the response from method VirtualHubBgpConnectionsClient.BeginListLearnedRoutes. +type VirtualHubBgpConnectionsClientListLearnedRoutesResponse struct { + PeerRouteList +} + +// VirtualHubBgpConnectionsClientListResponse contains the response from method VirtualHubBgpConnectionsClient.NewListPager. +type VirtualHubBgpConnectionsClientListResponse struct { + ListVirtualHubBgpConnectionResults +} + +// VirtualHubIPConfigurationClientCreateOrUpdateResponse contains the response from method VirtualHubIPConfigurationClient.BeginCreateOrUpdate. +type VirtualHubIPConfigurationClientCreateOrUpdateResponse struct { + HubIPConfiguration +} + +// VirtualHubIPConfigurationClientDeleteResponse contains the response from method VirtualHubIPConfigurationClient.BeginDelete. +type VirtualHubIPConfigurationClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualHubIPConfigurationClientGetResponse contains the response from method VirtualHubIPConfigurationClient.Get. +type VirtualHubIPConfigurationClientGetResponse struct { + HubIPConfiguration +} + +// VirtualHubIPConfigurationClientListResponse contains the response from method VirtualHubIPConfigurationClient.NewListPager. +type VirtualHubIPConfigurationClientListResponse struct { + ListVirtualHubIPConfigurationResults +} + +// VirtualHubRouteTableV2SClientCreateOrUpdateResponse contains the response from method VirtualHubRouteTableV2SClient.BeginCreateOrUpdate. +type VirtualHubRouteTableV2SClientCreateOrUpdateResponse struct { + VirtualHubRouteTableV2 +} + +// VirtualHubRouteTableV2SClientDeleteResponse contains the response from method VirtualHubRouteTableV2SClient.BeginDelete. +type VirtualHubRouteTableV2SClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualHubRouteTableV2SClientGetResponse contains the response from method VirtualHubRouteTableV2SClient.Get. +type VirtualHubRouteTableV2SClientGetResponse struct { + VirtualHubRouteTableV2 +} + +// VirtualHubRouteTableV2SClientListResponse contains the response from method VirtualHubRouteTableV2SClient.NewListPager. +type VirtualHubRouteTableV2SClientListResponse struct { + ListVirtualHubRouteTableV2SResult +} + +// VirtualHubsClientCreateOrUpdateResponse contains the response from method VirtualHubsClient.BeginCreateOrUpdate. +type VirtualHubsClientCreateOrUpdateResponse struct { + VirtualHub +} + +// VirtualHubsClientDeleteResponse contains the response from method VirtualHubsClient.BeginDelete. +type VirtualHubsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualHubsClientGetEffectiveVirtualHubRoutesResponse contains the response from method VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes. +type VirtualHubsClientGetEffectiveVirtualHubRoutesResponse struct { + // placeholder for future response values +} + +// VirtualHubsClientGetInboundRoutesResponse contains the response from method VirtualHubsClient.BeginGetInboundRoutes. +type VirtualHubsClientGetInboundRoutesResponse struct { + // placeholder for future response values +} + +// VirtualHubsClientGetOutboundRoutesResponse contains the response from method VirtualHubsClient.BeginGetOutboundRoutes. +type VirtualHubsClientGetOutboundRoutesResponse struct { + // placeholder for future response values +} + +// VirtualHubsClientGetResponse contains the response from method VirtualHubsClient.Get. +type VirtualHubsClientGetResponse struct { + VirtualHub +} + +// VirtualHubsClientListByResourceGroupResponse contains the response from method VirtualHubsClient.NewListByResourceGroupPager. +type VirtualHubsClientListByResourceGroupResponse struct { + ListVirtualHubsResult +} + +// VirtualHubsClientListResponse contains the response from method VirtualHubsClient.NewListPager. +type VirtualHubsClientListResponse struct { + ListVirtualHubsResult +} + +// VirtualHubsClientUpdateTagsResponse contains the response from method VirtualHubsClient.UpdateTags. +type VirtualHubsClientUpdateTagsResponse struct { + VirtualHub +} + +// VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate. +type VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse struct { + VirtualNetworkGatewayConnection +} + +// VirtualNetworkGatewayConnectionsClientDeleteResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginDelete. +type VirtualNetworkGatewayConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewayConnectionsClientGetIkeSasResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas. +type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse. +func (v *VirtualNetworkGatewayConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewayConnectionsClientGetResponse contains the response from method VirtualNetworkGatewayConnectionsClient.Get. +type VirtualNetworkGatewayConnectionsClientGetResponse struct { + VirtualNetworkGatewayConnection +} + +// VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.GetSharedKey. +type VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse struct { + ConnectionSharedKey +} + +// VirtualNetworkGatewayConnectionsClientListResponse contains the response from method VirtualNetworkGatewayConnectionsClient.NewListPager. +type VirtualNetworkGatewayConnectionsClientListResponse struct { + VirtualNetworkGatewayConnectionListResult +} + +// VirtualNetworkGatewayConnectionsClientResetConnectionResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginResetConnection. +type VirtualNetworkGatewayConnectionsClientResetConnectionResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey. +type VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse struct { + ConnectionResetSharedKey +} + +// VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey. +type VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse struct { + ConnectionSharedKey +} + +// VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture. +type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse. +func (v *VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture. +type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse. +func (v *VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewayConnectionsClientUpdateTagsResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginUpdateTags. +type VirtualNetworkGatewayConnectionsClientUpdateTagsResponse struct { + VirtualNetworkGatewayConnection +} + +// VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate. +type VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse struct { + VirtualNetworkGatewayNatRule +} + +// VirtualNetworkGatewayNatRulesClientDeleteResponse contains the response from method VirtualNetworkGatewayNatRulesClient.BeginDelete. +type VirtualNetworkGatewayNatRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewayNatRulesClientGetResponse contains the response from method VirtualNetworkGatewayNatRulesClient.Get. +type VirtualNetworkGatewayNatRulesClientGetResponse struct { + VirtualNetworkGatewayNatRule +} + +// VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse contains the response from method VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager. +type VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse struct { + ListVirtualNetworkGatewayNatRulesResult +} + +// VirtualNetworkGatewaysClientCreateOrUpdateResponse contains the response from method VirtualNetworkGatewaysClient.BeginCreateOrUpdate. +type VirtualNetworkGatewaysClientCreateOrUpdateResponse struct { + VirtualNetworkGateway +} + +// VirtualNetworkGatewaysClientDeleteResponse contains the response from method VirtualNetworkGatewaysClient.BeginDelete. +type VirtualNetworkGatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse contains the response from method VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections. +type VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientGenerateVPNProfileResponse contains the response from method VirtualNetworkGatewaysClient.BeginGenerateVPNProfile. +type VirtualNetworkGatewaysClientGenerateVPNProfileResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGenerateVPNProfileResponse. +func (v *VirtualNetworkGatewaysClientGenerateVPNProfileResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse contains the response from method VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage. +type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse. +func (v *VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes. +type VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse struct { + GatewayRouteListResult +} + +// VirtualNetworkGatewaysClientGetBgpPeerStatusResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus. +type VirtualNetworkGatewaysClientGetBgpPeerStatusResponse struct { + BgpPeerStatusListResult +} + +// VirtualNetworkGatewaysClientGetLearnedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetLearnedRoutes. +type VirtualNetworkGatewaysClientGetLearnedRoutesResponse struct { + GatewayRouteListResult +} + +// VirtualNetworkGatewaysClientGetResponse contains the response from method VirtualNetworkGatewaysClient.Get. +type VirtualNetworkGatewaysClientGetResponse struct { + VirtualNetworkGateway +} + +// VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL. +type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse. +func (v *VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth. +type VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse struct { + VPNClientConnectionHealthDetailListResult +} + +// VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters. +type VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse struct { + VPNClientIPsecParameters +} + +// VirtualNetworkGatewaysClientListConnectionsResponse contains the response from method VirtualNetworkGatewaysClient.NewListConnectionsPager. +type VirtualNetworkGatewaysClientListConnectionsResponse struct { + VirtualNetworkGatewayListConnectionsResult +} + +// VirtualNetworkGatewaysClientListResponse contains the response from method VirtualNetworkGatewaysClient.NewListPager. +type VirtualNetworkGatewaysClientListResponse struct { + VirtualNetworkGatewayListResult +} + +// VirtualNetworkGatewaysClientResetResponse contains the response from method VirtualNetworkGatewaysClient.BeginReset. +type VirtualNetworkGatewaysClientResetResponse struct { + VirtualNetworkGateway +} + +// VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse contains the response from method VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey. +type VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse contains the response from method VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters. +type VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse struct { + VPNClientIPsecParameters +} + +// VirtualNetworkGatewaysClientStartPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.BeginStartPacketCapture. +type VirtualNetworkGatewaysClientStartPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartPacketCaptureResponse. +func (v *VirtualNetworkGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewaysClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.BeginStopPacketCapture. +type VirtualNetworkGatewaysClientStopPacketCaptureResponse struct { + Value *string +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopPacketCaptureResponse. +func (v *VirtualNetworkGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// VirtualNetworkGatewaysClientSupportedVPNDevicesResponse contains the response from method VirtualNetworkGatewaysClient.SupportedVPNDevices. +type VirtualNetworkGatewaysClientSupportedVPNDevicesResponse struct { + Value *string +} + +// VirtualNetworkGatewaysClientUpdateTagsResponse contains the response from method VirtualNetworkGatewaysClient.BeginUpdateTags. +type VirtualNetworkGatewaysClientUpdateTagsResponse struct { + VirtualNetworkGateway +} + +// VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse contains the response from method VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript. +type VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse struct { + Value *string +} + +// VirtualNetworkPeeringsClientCreateOrUpdateResponse contains the response from method VirtualNetworkPeeringsClient.BeginCreateOrUpdate. +type VirtualNetworkPeeringsClientCreateOrUpdateResponse struct { + VirtualNetworkPeering +} + +// VirtualNetworkPeeringsClientDeleteResponse contains the response from method VirtualNetworkPeeringsClient.BeginDelete. +type VirtualNetworkPeeringsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworkPeeringsClientGetResponse contains the response from method VirtualNetworkPeeringsClient.Get. +type VirtualNetworkPeeringsClientGetResponse struct { + VirtualNetworkPeering +} + +// VirtualNetworkPeeringsClientListResponse contains the response from method VirtualNetworkPeeringsClient.NewListPager. +type VirtualNetworkPeeringsClientListResponse struct { + VirtualNetworkPeeringListResult +} + +// VirtualNetworkTapsClientCreateOrUpdateResponse contains the response from method VirtualNetworkTapsClient.BeginCreateOrUpdate. +type VirtualNetworkTapsClientCreateOrUpdateResponse struct { + VirtualNetworkTap +} + +// VirtualNetworkTapsClientDeleteResponse contains the response from method VirtualNetworkTapsClient.BeginDelete. +type VirtualNetworkTapsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworkTapsClientGetResponse contains the response from method VirtualNetworkTapsClient.Get. +type VirtualNetworkTapsClientGetResponse struct { + VirtualNetworkTap +} + +// VirtualNetworkTapsClientListAllResponse contains the response from method VirtualNetworkTapsClient.NewListAllPager. +type VirtualNetworkTapsClientListAllResponse struct { + VirtualNetworkTapListResult +} + +// VirtualNetworkTapsClientListByResourceGroupResponse contains the response from method VirtualNetworkTapsClient.NewListByResourceGroupPager. +type VirtualNetworkTapsClientListByResourceGroupResponse struct { + VirtualNetworkTapListResult +} + +// VirtualNetworkTapsClientUpdateTagsResponse contains the response from method VirtualNetworkTapsClient.UpdateTags. +type VirtualNetworkTapsClientUpdateTagsResponse struct { + VirtualNetworkTap +} + +// VirtualNetworksClientCheckIPAddressAvailabilityResponse contains the response from method VirtualNetworksClient.CheckIPAddressAvailability. +type VirtualNetworksClientCheckIPAddressAvailabilityResponse struct { + IPAddressAvailabilityResult +} + +// VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.BeginCreateOrUpdate. +type VirtualNetworksClientCreateOrUpdateResponse struct { + VirtualNetwork +} + +// VirtualNetworksClientDeleteResponse contains the response from method VirtualNetworksClient.BeginDelete. +type VirtualNetworksClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualNetworksClientGetResponse contains the response from method VirtualNetworksClient.Get. +type VirtualNetworksClientGetResponse struct { + VirtualNetwork +} + +// VirtualNetworksClientListAllResponse contains the response from method VirtualNetworksClient.NewListAllPager. +type VirtualNetworksClientListAllResponse struct { + VirtualNetworkListResult +} + +// VirtualNetworksClientListDdosProtectionStatusResponse contains the response from method VirtualNetworksClient.BeginListDdosProtectionStatus. +type VirtualNetworksClientListDdosProtectionStatusResponse struct { + VirtualNetworkDdosProtectionStatusResult +} + +// VirtualNetworksClientListResponse contains the response from method VirtualNetworksClient.NewListPager. +type VirtualNetworksClientListResponse struct { + VirtualNetworkListResult +} + +// VirtualNetworksClientListUsageResponse contains the response from method VirtualNetworksClient.NewListUsagePager. +type VirtualNetworksClientListUsageResponse struct { + VirtualNetworkListUsageResult +} + +// VirtualNetworksClientUpdateTagsResponse contains the response from method VirtualNetworksClient.UpdateTags. +type VirtualNetworksClientUpdateTagsResponse struct { + VirtualNetwork +} + +// VirtualRouterPeeringsClientCreateOrUpdateResponse contains the response from method VirtualRouterPeeringsClient.BeginCreateOrUpdate. +type VirtualRouterPeeringsClientCreateOrUpdateResponse struct { + VirtualRouterPeering +} + +// VirtualRouterPeeringsClientDeleteResponse contains the response from method VirtualRouterPeeringsClient.BeginDelete. +type VirtualRouterPeeringsClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualRouterPeeringsClientGetResponse contains the response from method VirtualRouterPeeringsClient.Get. +type VirtualRouterPeeringsClientGetResponse struct { + VirtualRouterPeering +} + +// VirtualRouterPeeringsClientListResponse contains the response from method VirtualRouterPeeringsClient.NewListPager. +type VirtualRouterPeeringsClientListResponse struct { + VirtualRouterPeeringListResult +} + +// VirtualRoutersClientCreateOrUpdateResponse contains the response from method VirtualRoutersClient.BeginCreateOrUpdate. +type VirtualRoutersClientCreateOrUpdateResponse struct { + VirtualRouter +} + +// VirtualRoutersClientDeleteResponse contains the response from method VirtualRoutersClient.BeginDelete. +type VirtualRoutersClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualRoutersClientGetResponse contains the response from method VirtualRoutersClient.Get. +type VirtualRoutersClientGetResponse struct { + VirtualRouter +} + +// VirtualRoutersClientListByResourceGroupResponse contains the response from method VirtualRoutersClient.NewListByResourceGroupPager. +type VirtualRoutersClientListByResourceGroupResponse struct { + VirtualRouterListResult +} + +// VirtualRoutersClientListResponse contains the response from method VirtualRoutersClient.NewListPager. +type VirtualRoutersClientListResponse struct { + VirtualRouterListResult +} + +// VirtualWansClientCreateOrUpdateResponse contains the response from method VirtualWansClient.BeginCreateOrUpdate. +type VirtualWansClientCreateOrUpdateResponse struct { + VirtualWAN +} + +// VirtualWansClientDeleteResponse contains the response from method VirtualWansClient.BeginDelete. +type VirtualWansClientDeleteResponse struct { + // placeholder for future response values +} + +// VirtualWansClientGetResponse contains the response from method VirtualWansClient.Get. +type VirtualWansClientGetResponse struct { + VirtualWAN +} + +// VirtualWansClientListByResourceGroupResponse contains the response from method VirtualWansClient.NewListByResourceGroupPager. +type VirtualWansClientListByResourceGroupResponse struct { + ListVirtualWANsResult +} + +// VirtualWansClientListResponse contains the response from method VirtualWansClient.NewListPager. +type VirtualWansClientListResponse struct { + ListVirtualWANsResult +} + +// VirtualWansClientUpdateTagsResponse contains the response from method VirtualWansClient.UpdateTags. +type VirtualWansClientUpdateTagsResponse struct { + VirtualWAN +} + +// WatchersClientCheckConnectivityResponse contains the response from method WatchersClient.BeginCheckConnectivity. +type WatchersClientCheckConnectivityResponse struct { + ConnectivityInformation +} + +// WatchersClientCreateOrUpdateResponse contains the response from method WatchersClient.CreateOrUpdate. +type WatchersClientCreateOrUpdateResponse struct { + Watcher +} + +// WatchersClientDeleteResponse contains the response from method WatchersClient.BeginDelete. +type WatchersClientDeleteResponse struct { + // placeholder for future response values +} + +// WatchersClientGetAzureReachabilityReportResponse contains the response from method WatchersClient.BeginGetAzureReachabilityReport. +type WatchersClientGetAzureReachabilityReportResponse struct { + AzureReachabilityReport +} + +// WatchersClientGetFlowLogStatusResponse contains the response from method WatchersClient.BeginGetFlowLogStatus. +type WatchersClientGetFlowLogStatusResponse struct { + FlowLogInformation +} + +// WatchersClientGetNetworkConfigurationDiagnosticResponse contains the response from method WatchersClient.BeginGetNetworkConfigurationDiagnostic. +type WatchersClientGetNetworkConfigurationDiagnosticResponse struct { + ConfigurationDiagnosticResponse +} + +// WatchersClientGetNextHopResponse contains the response from method WatchersClient.BeginGetNextHop. +type WatchersClientGetNextHopResponse struct { + NextHopResult +} + +// WatchersClientGetResponse contains the response from method WatchersClient.Get. +type WatchersClientGetResponse struct { + Watcher +} + +// WatchersClientGetTopologyResponse contains the response from method WatchersClient.GetTopology. +type WatchersClientGetTopologyResponse struct { + Topology +} + +// WatchersClientGetTroubleshootingResponse contains the response from method WatchersClient.BeginGetTroubleshooting. +type WatchersClientGetTroubleshootingResponse struct { + TroubleshootingResult +} + +// WatchersClientGetTroubleshootingResultResponse contains the response from method WatchersClient.BeginGetTroubleshootingResult. +type WatchersClientGetTroubleshootingResultResponse struct { + TroubleshootingResult +} + +// WatchersClientGetVMSecurityRulesResponse contains the response from method WatchersClient.BeginGetVMSecurityRules. +type WatchersClientGetVMSecurityRulesResponse struct { + SecurityGroupViewResult +} + +// WatchersClientListAllResponse contains the response from method WatchersClient.NewListAllPager. +type WatchersClientListAllResponse struct { + WatcherListResult +} + +// WatchersClientListAvailableProvidersResponse contains the response from method WatchersClient.BeginListAvailableProviders. +type WatchersClientListAvailableProvidersResponse struct { + AvailableProvidersList +} + +// WatchersClientListResponse contains the response from method WatchersClient.NewListPager. +type WatchersClientListResponse struct { + WatcherListResult +} + +// WatchersClientSetFlowLogConfigurationResponse contains the response from method WatchersClient.BeginSetFlowLogConfiguration. +type WatchersClientSetFlowLogConfigurationResponse struct { + FlowLogInformation +} + +// WatchersClientUpdateTagsResponse contains the response from method WatchersClient.UpdateTags. +type WatchersClientUpdateTagsResponse struct { + Watcher +} + +// WatchersClientVerifyIPFlowResponse contains the response from method WatchersClient.BeginVerifyIPFlow. +type WatchersClientVerifyIPFlowResponse struct { + VerificationIPFlowResult +} + +// WebApplicationFirewallPoliciesClientCreateOrUpdateResponse contains the response from method WebApplicationFirewallPoliciesClient.CreateOrUpdate. +type WebApplicationFirewallPoliciesClientCreateOrUpdateResponse struct { + WebApplicationFirewallPolicy +} + +// WebApplicationFirewallPoliciesClientDeleteResponse contains the response from method WebApplicationFirewallPoliciesClient.BeginDelete. +type WebApplicationFirewallPoliciesClientDeleteResponse struct { + // placeholder for future response values +} + +// WebApplicationFirewallPoliciesClientGetResponse contains the response from method WebApplicationFirewallPoliciesClient.Get. +type WebApplicationFirewallPoliciesClientGetResponse struct { + WebApplicationFirewallPolicy +} + +// WebApplicationFirewallPoliciesClientListAllResponse contains the response from method WebApplicationFirewallPoliciesClient.NewListAllPager. +type WebApplicationFirewallPoliciesClientListAllResponse struct { + WebApplicationFirewallPolicyListResult +} + +// WebApplicationFirewallPoliciesClientListResponse contains the response from method WebApplicationFirewallPoliciesClient.NewListPager. +type WebApplicationFirewallPoliciesClientListResponse struct { + WebApplicationFirewallPolicyListResult +} + +// WebCategoriesClientGetResponse contains the response from method WebCategoriesClient.Get. +type WebCategoriesClientGetResponse struct { + AzureWebCategory +} + +// WebCategoriesClientListBySubscriptionResponse contains the response from method WebCategoriesClient.NewListBySubscriptionPager. +type WebCategoriesClientListBySubscriptionResponse struct { + AzureWebCategoryListResult +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilterrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilterrules_client.go new file mode 100644 index 00000000000..ce4766c471b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilterrules_client.go @@ -0,0 +1,323 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RouteFilterRulesClient contains the methods for the RouteFilterRules group. +// Don't use this type directly, use NewRouteFilterRulesClient() instead. +type RouteFilterRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRouteFilterRulesClient creates a new instance of RouteFilterRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRouteFilterRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFilterRulesClient, error) { + cl, err := arm.NewClient(moduleName+".RouteFilterRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RouteFilterRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a route in the specified route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - ruleName - The name of the route filter rule. +// - routeFilterRuleParameters - Parameters supplied to the create or update route filter rule operation. +// - options - RouteFilterRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFilterRulesClient.BeginCreateOrUpdate +// method. +func (client *RouteFilterRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteFilterRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteFilterRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteFilterRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a route in the specified route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteFilterRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routeFilterRuleParameters) +} + +// BeginDelete - Deletes the specified rule from a route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - ruleName - The name of the rule. +// - options - RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete +// method. +func (client *RouteFilterRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*runtime.Poller[RouteFilterRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, routeFilterName, ruleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteFilterRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteFilterRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified rule from a route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteFilterRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified rule from a route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - ruleName - The name of the rule. +// - options - RouteFilterRulesClientGetOptions contains the optional parameters for the RouteFilterRulesClient.Get method. +func (client *RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientGetOptions) (RouteFilterRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, routeFilterName, ruleName, options) + if err != nil { + return RouteFilterRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFilterRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFilterRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, options *RouteFilterRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (RouteFilterRulesClientGetResponse, error) { + result := RouteFilterRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterRule); err != nil { + return RouteFilterRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - options - RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.NewListByRouteFilterPager +// method. +func (client *RouteFilterRulesClient) NewListByRouteFilterPager(resourceGroupName string, routeFilterName string, options *RouteFilterRulesClientListByRouteFilterOptions) *runtime.Pager[RouteFilterRulesClientListByRouteFilterResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteFilterRulesClientListByRouteFilterResponse]{ + More: func(page RouteFilterRulesClientListByRouteFilterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteFilterRulesClientListByRouteFilterResponse) (RouteFilterRulesClientListByRouteFilterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByRouteFilterCreateRequest(ctx, resourceGroupName, routeFilterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteFilterRulesClientListByRouteFilterResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFilterRulesClientListByRouteFilterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFilterRulesClientListByRouteFilterResponse{}, runtime.NewResponseError(resp) + } + return client.listByRouteFilterHandleResponse(resp) + }, + }) +} + +// listByRouteFilterCreateRequest creates the ListByRouteFilter request. +func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFilterRulesClientListByRouteFilterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByRouteFilterHandleResponse handles the ListByRouteFilter response. +func (client *RouteFilterRulesClient) listByRouteFilterHandleResponse(resp *http.Response) (RouteFilterRulesClientListByRouteFilterResponse, error) { + result := RouteFilterRulesClientListByRouteFilterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterRuleListResult); err != nil { + return RouteFilterRulesClientListByRouteFilterResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilters_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilters_client.go new file mode 100644 index 00000000000..ec5a849ad41 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routefilters_client.go @@ -0,0 +1,423 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RouteFiltersClient contains the methods for the RouteFilters group. +// Don't use this type directly, use NewRouteFiltersClient() instead. +type RouteFiltersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRouteFiltersClient creates a new instance of RouteFiltersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRouteFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteFiltersClient, error) { + cl, err := arm.NewClient(moduleName+".RouteFiltersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RouteFiltersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a route filter in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - routeFilterParameters - Parameters supplied to the create or update route filter operation. +// - options - RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate +// method. +func (client *RouteFiltersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteFiltersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, routeFilterName, routeFilterParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteFiltersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteFiltersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a route filter in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteFiltersClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeFilterName, routeFilterParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routeFilterParameters) +} + +// BeginDelete - Deletes the specified route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - options - RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete +// method. +func (client *RouteFiltersClient) BeginDelete(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*runtime.Poller[RouteFiltersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, routeFilterName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteFiltersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteFiltersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeFilterName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - options - RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. +func (client *RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (RouteFiltersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, routeFilterName, options) + if err != nil { + return RouteFiltersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFiltersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFiltersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteFiltersClientGetResponse, error) { + result := RouteFiltersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilter); err != nil { + return RouteFiltersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all route filters in a subscription. +// +// Generated from API version 2022-09-01 +// - options - RouteFiltersClientListOptions contains the optional parameters for the RouteFiltersClient.NewListPager method. +func (client *RouteFiltersClient) NewListPager(options *RouteFiltersClientListOptions) *runtime.Pager[RouteFiltersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListResponse]{ + More: func(page RouteFiltersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteFiltersClientListResponse) (RouteFiltersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteFiltersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFiltersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFiltersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options *RouteFiltersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (RouteFiltersClientListResponse, error) { + result := RouteFiltersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterListResult); err != nil { + return RouteFiltersClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all route filters in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager +// method. +func (client *RouteFiltersClient) NewListByResourceGroupPager(resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) *runtime.Pager[RouteFiltersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteFiltersClientListByResourceGroupResponse]{ + More: func(page RouteFiltersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteFiltersClientListByResourceGroupResponse) (RouteFiltersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteFiltersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFiltersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFiltersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *RouteFiltersClient) listByResourceGroupHandleResponse(resp *http.Response) (RouteFiltersClientListByResourceGroupResponse, error) { + result := RouteFiltersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilterListResult); err != nil { + return RouteFiltersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags of a route filter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeFilterName - The name of the route filter. +// - parameters - Parameters supplied to update route filter tags. +// - options - RouteFiltersClientUpdateTagsOptions contains the optional parameters for the RouteFiltersClient.UpdateTags method. +func (client *RouteFiltersClient) UpdateTags(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject, options *RouteFiltersClientUpdateTagsOptions) (RouteFiltersClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, routeFilterName, parameters, options) + if err != nil { + return RouteFiltersClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteFiltersClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteFiltersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject, options *RouteFiltersClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeFilterName == "" { + return nil, errors.New("parameter routeFilterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeFilterName}", url.PathEscape(routeFilterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *RouteFiltersClient) updateTagsHandleResponse(resp *http.Response) (RouteFiltersClientUpdateTagsResponse, error) { + result := RouteFiltersClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteFilter); err != nil { + return RouteFiltersClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routemaps_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routemaps_client.go new file mode 100644 index 00000000000..f1e5070c575 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routemaps_client.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RouteMapsClient contains the methods for the RouteMaps group. +// Don't use this type directly, use NewRouteMapsClient() instead. +type RouteMapsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRouteMapsClient creates a new instance of RouteMapsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRouteMapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteMapsClient, error) { + cl, err := arm.NewClient(moduleName+".RouteMapsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RouteMapsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RouteMap's resource group. +// - virtualHubName - The name of the VirtualHub containing the RouteMap. +// - routeMapName - The name of the RouteMap. +// - routeMapParameters - Parameters supplied to create or update a RouteMap. +// - options - RouteMapsClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteMapsClient.BeginCreateOrUpdate +// method. +func (client *RouteMapsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteMapsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routeMapName, routeMapParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteMapsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteMapsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a RouteMap if it doesn't exist else updates the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteMapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routeMapName, routeMapParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeMapName == "" { + return nil, errors.New("parameter routeMapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeMapName}", url.PathEscape(routeMapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routeMapParameters) +} + +// BeginDelete - Deletes a RouteMap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RouteMap's resource group. +// - virtualHubName - The name of the VirtualHub containing the RouteMap. +// - routeMapName - The name of the RouteMap. +// - options - RouteMapsClientBeginDeleteOptions contains the optional parameters for the RouteMapsClient.BeginDelete method. +func (client *RouteMapsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*runtime.Poller[RouteMapsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routeMapName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteMapsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteMapsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a RouteMap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteMapsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routeMapName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeMapName == "" { + return nil, errors.New("parameter routeMapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeMapName}", url.PathEscape(routeMapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a RouteMap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RouteMap's resource group. +// - virtualHubName - The name of the VirtualHub containing the RouteMap. +// - routeMapName - The name of the RouteMap. +// - options - RouteMapsClientGetOptions contains the optional parameters for the RouteMapsClient.Get method. +func (client *RouteMapsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientGetOptions) (RouteMapsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routeMapName, options) + if err != nil { + return RouteMapsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteMapsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteMapsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeMapName == "" { + return nil, errors.New("parameter routeMapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeMapName}", url.PathEscape(routeMapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RouteMapsClient) getHandleResponse(resp *http.Response) (RouteMapsClientGetResponse, error) { + result := RouteMapsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteMap); err != nil { + return RouteMapsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all RouteMaps. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RouteMap's resource group'. +// - virtualHubName - The name of the VirtualHub containing the RouteMap. +// - options - RouteMapsClientListOptions contains the optional parameters for the RouteMapsClient.NewListPager method. +func (client *RouteMapsClient) NewListPager(resourceGroupName string, virtualHubName string, options *RouteMapsClientListOptions) *runtime.Pager[RouteMapsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteMapsClientListResponse]{ + More: func(page RouteMapsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteMapsClientListResponse) (RouteMapsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteMapsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteMapsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteMapsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *RouteMapsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RouteMapsClient) listHandleResponse(resp *http.Response) (RouteMapsClientListResponse, error) { + result := RouteMapsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListRouteMapsResult); err != nil { + return RouteMapsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routes_client.go new file mode 100644 index 00000000000..ccf2da24531 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routes_client.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RoutesClient contains the methods for the Routes group. +// Don't use this type directly, use NewRoutesClient() instead. +type RoutesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRoutesClient creates a new instance of RoutesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutesClient, error) { + cl, err := arm.NewClient(moduleName+".RoutesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RoutesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a route in the specified route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - routeName - The name of the route. +// - routeParameters - Parameters supplied to the create or update route operation. +// - options - RoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutesClient.BeginCreateOrUpdate +// method. +func (client *RoutesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RoutesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, routeTableName, routeName, routeParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a route in the specified route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RoutesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeTableName, routeName, routeParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route, options *RoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routeParameters) +} + +// BeginDelete - Deletes the specified route from a route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - routeName - The name of the route. +// - options - RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. +func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*runtime.Poller[RoutesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, routeTableName, routeName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified route from a route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeTableName, routeName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified route from a route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - routeName - The name of the route. +// - options - RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. +func (client *RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientGetOptions) (RoutesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, routeTableName, routeName, options) + if err != nil { + return RoutesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RoutesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RoutesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, options *RoutesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClientGetResponse, error) { + result := RoutesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Route); err != nil { + return RoutesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all routes in a route table. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - options - RoutesClientListOptions contains the optional parameters for the RoutesClient.NewListPager method. +func (client *RoutesClient) NewListPager(resourceGroupName string, routeTableName string, options *RoutesClientListOptions) *runtime.Pager[RoutesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RoutesClientListResponse]{ + More: func(page RoutesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RoutesClientListResponse) (RoutesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, routeTableName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RoutesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RoutesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RoutesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RoutesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RoutesClient) listHandleResponse(resp *http.Response) (RoutesClientListResponse, error) { + result := RoutesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteListResult); err != nil { + return RoutesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routetables_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routetables_client.go new file mode 100644 index 00000000000..868842bce93 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routetables_client.go @@ -0,0 +1,421 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RouteTablesClient contains the methods for the RouteTables group. +// Don't use this type directly, use NewRouteTablesClient() instead. +type RouteTablesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRouteTablesClient creates a new instance of RouteTablesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRouteTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RouteTablesClient, error) { + cl, err := arm.NewClient(moduleName+".RouteTablesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RouteTablesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or updates a route table in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - parameters - Parameters supplied to the create or update route table operation. +// - options - RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate +// method. +func (client *RouteTablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RouteTablesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, routeTableName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteTablesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteTablesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or updates a route table in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteTablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, routeTableName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable, options *RouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - options - RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. +func (client *RouteTablesClient) BeginDelete(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*runtime.Poller[RouteTablesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, routeTableName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RouteTablesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RouteTablesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, routeTableName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified route table. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - options - RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. +func (client *RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (RouteTablesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, routeTableName, options) + if err != nil { + return RouteTablesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteTablesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteTablesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTablesClientGetResponse, error) { + result := RouteTablesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteTable); err != nil { + return RouteTablesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all route tables in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.NewListPager method. +func (client *RouteTablesClient) NewListPager(resourceGroupName string, options *RouteTablesClientListOptions) *runtime.Pager[RouteTablesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListResponse]{ + More: func(page RouteTablesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteTablesClientListResponse) (RouteTablesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteTablesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteTablesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteTablesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RouteTablesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteTablesClientListResponse, error) { + result := RouteTablesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil { + return RouteTablesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all route tables in a subscription. +// +// Generated from API version 2022-09-01 +// - options - RouteTablesClientListAllOptions contains the optional parameters for the RouteTablesClient.NewListAllPager method. +func (client *RouteTablesClient) NewListAllPager(options *RouteTablesClientListAllOptions) *runtime.Pager[RouteTablesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[RouteTablesClientListAllResponse]{ + More: func(page RouteTablesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RouteTablesClientListAllResponse) (RouteTablesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RouteTablesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteTablesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteTablesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, options *RouteTablesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *RouteTablesClient) listAllHandleResponse(resp *http.Response) (RouteTablesClientListAllResponse, error) { + result := RouteTablesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteTableListResult); err != nil { + return RouteTablesClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a route table tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - routeTableName - The name of the route table. +// - parameters - Parameters supplied to update route table tags. +// - options - RouteTablesClientUpdateTagsOptions contains the optional parameters for the RouteTablesClient.UpdateTags method. +func (client *RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject, options *RouteTablesClientUpdateTagsOptions) (RouteTablesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, routeTableName, parameters, options) + if err != nil { + return RouteTablesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RouteTablesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RouteTablesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject, options *RouteTablesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *RouteTablesClient) updateTagsHandleResponse(resp *http.Response) (RouteTablesClientUpdateTagsResponse, error) { + result := RouteTablesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RouteTable); err != nil { + return RouteTablesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routingintent_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routingintent_client.go new file mode 100644 index 00000000000..a0df5b25eeb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/routingintent_client.go @@ -0,0 +1,322 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// RoutingIntentClient contains the methods for the RoutingIntent group. +// Don't use this type directly, use NewRoutingIntentClient() instead. +type RoutingIntentClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRoutingIntentClient creates a new instance of RoutingIntentClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRoutingIntentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutingIntentClient, error) { + cl, err := arm.NewClient(moduleName+".RoutingIntentClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RoutingIntentClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RoutingIntent. +// - virtualHubName - The name of the VirtualHub. +// - routingIntentName - The name of the per VirtualHub singleton Routing Intent resource. +// - routingIntentParameters - Parameters supplied to create or update RoutingIntent. +// - options - RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate +// method. +func (client *RoutingIntentClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*runtime.Poller[RoutingIntentClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingIntentClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutingIntentClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RoutingIntentClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routingIntentName == "" { + return nil, errors.New("parameter routingIntentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, routingIntentParameters) +} + +// BeginDelete - Deletes a RoutingIntent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RoutingIntent. +// - virtualHubName - The name of the VirtualHub. +// - routingIntentName - The name of the RoutingIntent. +// - options - RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete +// method. +func (client *RoutingIntentClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*runtime.Poller[RoutingIntentClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routingIntentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutingIntentClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutingIntentClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a RoutingIntent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *RoutingIntentClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routingIntentName == "" { + return nil, errors.New("parameter routingIntentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a RoutingIntent. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the RoutingIntent. +// - virtualHubName - The name of the VirtualHub. +// - routingIntentName - The name of the RoutingIntent. +// - options - RoutingIntentClientGetOptions contains the optional parameters for the RoutingIntentClient.Get method. +func (client *RoutingIntentClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (RoutingIntentClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routingIntentName, options) + if err != nil { + return RoutingIntentClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RoutingIntentClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RoutingIntentClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routingIntentName == "" { + return nil, errors.New("parameter routingIntentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routingIntentName}", url.PathEscape(routingIntentName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RoutingIntentClient) getHandleResponse(resp *http.Response) (RoutingIntentClientGetResponse, error) { + result := RoutingIntentClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RoutingIntent); err != nil { + return RoutingIntentClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all RoutingIntent child resources of the VirtualHub. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.NewListPager method. +func (client *RoutingIntentClient) NewListPager(resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) *runtime.Pager[RoutingIntentClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RoutingIntentClientListResponse]{ + More: func(page RoutingIntentClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RoutingIntentClientListResponse) (RoutingIntentClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RoutingIntentClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RoutingIntentClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RoutingIntentClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RoutingIntentClient) listHandleResponse(resp *http.Response) (RoutingIntentClientListResponse, error) { + result := RoutingIntentClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListRoutingIntentResult); err != nil { + return RoutingIntentClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/scopeconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/scopeconnections_client.go new file mode 100644 index 00000000000..0ca8ac71140 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/scopeconnections_client.go @@ -0,0 +1,302 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ScopeConnectionsClient contains the methods for the ScopeConnections group. +// Don't use this type directly, use NewScopeConnectionsClient() instead. +type ScopeConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewScopeConnectionsClient creates a new instance of ScopeConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewScopeConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScopeConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".ScopeConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ScopeConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates scope connection from Network Manager +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - scopeConnectionName - Name for the cross-tenant connection. +// - parameters - Scope connection to be created/updated. +// - options - ScopeConnectionsClientCreateOrUpdateOptions contains the optional parameters for the ScopeConnectionsClient.CreateOrUpdate +// method. +func (client *ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, options *ScopeConnectionsClientCreateOrUpdateOptions) (ScopeConnectionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, parameters, options) + if err != nil { + return ScopeConnectionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ScopeConnectionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ScopeConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, options *ScopeConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if scopeConnectionName == "" { + return nil, errors.New("parameter scopeConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ScopeConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (ScopeConnectionsClientCreateOrUpdateResponse, error) { + result := ScopeConnectionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnection); err != nil { + return ScopeConnectionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete the pending scope connection created by this network manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - scopeConnectionName - Name for the cross-tenant connection. +// - options - ScopeConnectionsClientDeleteOptions contains the optional parameters for the ScopeConnectionsClient.Delete method. +func (client *ScopeConnectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientDeleteOptions) (ScopeConnectionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, options) + if err != nil { + return ScopeConnectionsClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ScopeConnectionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ScopeConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ScopeConnectionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if scopeConnectionName == "" { + return nil, errors.New("parameter scopeConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get specified scope connection created by this Network Manager. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - scopeConnectionName - Name for the cross-tenant connection. +// - options - ScopeConnectionsClientGetOptions contains the optional parameters for the ScopeConnectionsClient.Get method. +func (client *ScopeConnectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientGetOptions) (ScopeConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, scopeConnectionName, options) + if err != nil { + return ScopeConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ScopeConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScopeConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if scopeConnectionName == "" { + return nil, errors.New("parameter scopeConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scopeConnectionName}", url.PathEscape(scopeConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ScopeConnectionsClient) getHandleResponse(resp *http.Response) (ScopeConnectionsClientGetResponse, error) { + result := ScopeConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnection); err != nil { + return ScopeConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all scope connections created by this network manager. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager +// method. +func (client *ScopeConnectionsClient) NewListPager(resourceGroupName string, networkManagerName string, options *ScopeConnectionsClientListOptions) *runtime.Pager[ScopeConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ScopeConnectionsClientListResponse]{ + More: func(page ScopeConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ScopeConnectionsClientListResponse) (ScopeConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ScopeConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ScopeConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScopeConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ScopeConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ScopeConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ScopeConnectionsClient) listHandleResponse(resp *http.Response) (ScopeConnectionsClientListResponse, error) { + result := ScopeConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScopeConnectionListResult); err != nil { + return ScopeConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityadminconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityadminconfigurations_client.go new file mode 100644 index 00000000000..25ecc06d689 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityadminconfigurations_client.go @@ -0,0 +1,325 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SecurityAdminConfigurationsClient contains the methods for the SecurityAdminConfigurations group. +// Don't use this type directly, use NewSecurityAdminConfigurationsClient() instead. +type SecurityAdminConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSecurityAdminConfigurationsClient creates a new instance of SecurityAdminConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityAdminConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityAdminConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".SecurityAdminConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityAdminConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a network manager security admin configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - securityAdminConfiguration - The security admin configuration to create or update +// - options - SecurityAdminConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityAdminConfigurationsClient.CreateOrUpdate +// method. +func (client *SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, options *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, securityAdminConfiguration, options) + if err != nil { + return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, options *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, securityAdminConfiguration) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityAdminConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientCreateOrUpdateResponse, error) { + result := SecurityAdminConfigurationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfiguration); err != nil { + return SecurityAdminConfigurationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a network manager security admin configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - options - SecurityAdminConfigurationsClientBeginDeleteOptions contains the optional parameters for the SecurityAdminConfigurationsClient.BeginDelete +// method. +func (client *SecurityAdminConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*runtime.Poller[SecurityAdminConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityAdminConfigurationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityAdminConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a network manager security admin configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityAdminConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves a network manager security admin configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - configurationName - The name of the network manager Security Configuration. +// - options - SecurityAdminConfigurationsClientGetOptions contains the optional parameters for the SecurityAdminConfigurationsClient.Get +// method. +func (client *SecurityAdminConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientGetOptions) (SecurityAdminConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, configurationName, options) + if err != nil { + return SecurityAdminConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityAdminConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityAdminConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityAdminConfigurationsClient) getHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientGetResponse, error) { + result := SecurityAdminConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfiguration); err != nil { + return SecurityAdminConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the network manager security admin configurations in a network manager, in a paginated format. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - options - SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.NewListPager +// method. +func (client *SecurityAdminConfigurationsClient) NewListPager(resourceGroupName string, networkManagerName string, options *SecurityAdminConfigurationsClientListOptions) *runtime.Pager[SecurityAdminConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityAdminConfigurationsClientListResponse]{ + More: func(page SecurityAdminConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityAdminConfigurationsClientListResponse) (SecurityAdminConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityAdminConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityAdminConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityAdminConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityAdminConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *SecurityAdminConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityAdminConfigurationsClient) listHandleResponse(resp *http.Response) (SecurityAdminConfigurationsClientListResponse, error) { + result := SecurityAdminConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityAdminConfigurationListResult); err != nil { + return SecurityAdminConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitygroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitygroups_client.go new file mode 100644 index 00000000000..ad9a9305e25 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitygroups_client.go @@ -0,0 +1,424 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SecurityGroupsClient contains the methods for the NetworkSecurityGroups group. +// Don't use this type directly, use NewSecurityGroupsClient() instead. +type SecurityGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSecurityGroupsClient creates a new instance of SecurityGroupsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".SecurityGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a network security group in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - parameters - Parameters supplied to the create or update network security group operation. +// - options - SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate +// method. +func (client *SecurityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a network security group in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - options - SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete +// method. +func (client *SecurityGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*runtime.Poller[SecurityGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - options - SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. +func (client *SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (SecurityGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) + if err != nil { + return SecurityGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (SecurityGroupsClientGetResponse, error) { + result := SecurityGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroup); err != nil { + return SecurityGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all network security groups in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.NewListPager method. +func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, options *SecurityGroupsClientListOptions) *runtime.Pager[SecurityGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityGroupsClientListResponse]{ + More: func(page SecurityGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityGroupsClientListResponse) (SecurityGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (SecurityGroupsClientListResponse, error) { + result := SecurityGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroupListResult); err != nil { + return SecurityGroupsClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all network security groups in a subscription. +// +// Generated from API version 2022-09-01 +// - options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager +// method. +func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityGroupsClientListAllResponse]{ + More: func(page SecurityGroupsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityGroupsClientListAllResponse) (SecurityGroupsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityGroupsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityGroupsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityGroupsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *SecurityGroupsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *SecurityGroupsClient) listAllHandleResponse(resp *http.Response) (SecurityGroupsClientListAllResponse, error) { + result := SecurityGroupsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroupListResult); err != nil { + return SecurityGroupsClientListAllResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a network security group tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - parameters - Parameters supplied to update network security group tags. +// - options - SecurityGroupsClientUpdateTagsOptions contains the optional parameters for the SecurityGroupsClient.UpdateTags +// method. +func (client *SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject, options *SecurityGroupsClientUpdateTagsOptions) (SecurityGroupsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, parameters, options) + if err != nil { + return SecurityGroupsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityGroupsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityGroupsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject, options *SecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *SecurityGroupsClient) updateTagsHandleResponse(resp *http.Response) (SecurityGroupsClientUpdateTagsResponse, error) { + result := SecurityGroupsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityGroup); err != nil { + return SecurityGroupsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitypartnerproviders_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitypartnerproviders_client.go new file mode 100644 index 00000000000..01b4c0b6e52 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securitypartnerproviders_client.go @@ -0,0 +1,423 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SecurityPartnerProvidersClient contains the methods for the SecurityPartnerProviders group. +// Don't use this type directly, use NewSecurityPartnerProvidersClient() instead. +type SecurityPartnerProvidersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSecurityPartnerProvidersClient creates a new instance of SecurityPartnerProvidersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPartnerProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPartnerProvidersClient, error) { + cl, err := arm.NewClient(moduleName+".SecurityPartnerProvidersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPartnerProvidersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Security Partner Provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - securityPartnerProviderName - The name of the Security Partner Provider. +// - parameters - Parameters supplied to the create or update Security Partner Provider operation. +// - options - SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate +// method. +func (client *SecurityPartnerProvidersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityPartnerProvidersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPartnerProvidersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityPartnerProvidersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Security Partner Provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityPartnerProvidersClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityPartnerProviderName == "" { + return nil, errors.New("parameter securityPartnerProviderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Security Partner Provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - securityPartnerProviderName - The name of the Security Partner Provider. +// - options - SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete +// method. +func (client *SecurityPartnerProvidersClient) BeginDelete(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*runtime.Poller[SecurityPartnerProvidersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, securityPartnerProviderName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPartnerProvidersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityPartnerProvidersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Security Partner Provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityPartnerProviderName == "" { + return nil, errors.New("parameter securityPartnerProviderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Security Partner Provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - securityPartnerProviderName - The name of the Security Partner Provider. +// - options - SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get +// method. +func (client *SecurityPartnerProvidersClient) Get(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientGetOptions) (SecurityPartnerProvidersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, options) + if err != nil { + return SecurityPartnerProvidersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPartnerProvidersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityPartnerProvidersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityPartnerProviderName == "" { + return nil, errors.New("parameter securityPartnerProviderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientGetResponse, error) { + result := SecurityPartnerProvidersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProvider); err != nil { + return SecurityPartnerProvidersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the Security Partner Providers in a subscription. +// +// Generated from API version 2022-09-01 +// - options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager +// method. +func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPartnerProvidersClientListResponse]{ + More: func(page SecurityPartnerProvidersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPartnerProvidersClientListResponse) (SecurityPartnerProvidersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityPartnerProvidersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPartnerProvidersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityPartnerProvidersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Context, options *SecurityPartnerProvidersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientListResponse, error) { + result := SecurityPartnerProvidersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProviderListResult); err != nil { + return SecurityPartnerProvidersClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager +// method. +func (client *SecurityPartnerProvidersClient) NewListByResourceGroupPager(resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) *runtime.Pager[SecurityPartnerProvidersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPartnerProvidersClientListByResourceGroupResponse]{ + More: func(page SecurityPartnerProvidersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPartnerProvidersClientListByResourceGroupResponse) (SecurityPartnerProvidersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityPartnerProvidersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *SecurityPartnerProvidersClient) listByResourceGroupHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientListByResourceGroupResponse, error) { + result := SecurityPartnerProvidersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProviderListResult); err != nil { + return SecurityPartnerProvidersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags of a Security Partner Provider resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - securityPartnerProviderName - The name of the Security Partner Provider. +// - parameters - Parameters supplied to update Security Partner Provider tags. +// - options - SecurityPartnerProvidersClientUpdateTagsOptions contains the optional parameters for the SecurityPartnerProvidersClient.UpdateTags +// method. +func (client *SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject, options *SecurityPartnerProvidersClientUpdateTagsOptions) (SecurityPartnerProvidersClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, securityPartnerProviderName, parameters, options) + if err != nil { + return SecurityPartnerProvidersClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPartnerProvidersClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityPartnerProvidersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject, options *SecurityPartnerProvidersClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityPartnerProviderName == "" { + return nil, errors.New("parameter securityPartnerProviderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityPartnerProviderName}", url.PathEscape(securityPartnerProviderName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *SecurityPartnerProvidersClient) updateTagsHandleResponse(resp *http.Response) (SecurityPartnerProvidersClientUpdateTagsResponse, error) { + result := SecurityPartnerProvidersClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPartnerProvider); err != nil { + return SecurityPartnerProvidersClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityrules_client.go new file mode 100644 index 00000000000..0b868d2cbe6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/securityrules_client.go @@ -0,0 +1,322 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SecurityRulesClient contains the methods for the SecurityRules group. +// Don't use this type directly, use NewSecurityRulesClient() instead. +type SecurityRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSecurityRulesClient creates a new instance of SecurityRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityRulesClient, error) { + cl, err := arm.NewClient(moduleName+".SecurityRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a security rule in the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - securityRuleName - The name of the security rule. +// - securityRuleParameters - Parameters supplied to the create or update network security rule operation. +// - options - SecurityRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityRulesClient.BeginCreateOrUpdate +// method. +func (client *SecurityRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a security rule in the specified network security group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + if securityRuleName == "" { + return nil, errors.New("parameter securityRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, securityRuleParameters) +} + +// BeginDelete - Deletes the specified network security rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - securityRuleName - The name of the security rule. +// - options - SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete +// method. +func (client *SecurityRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*runtime.Poller[SecurityRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecurityRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network security rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SecurityRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + if securityRuleName == "" { + return nil, errors.New("parameter securityRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the specified network security rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - securityRuleName - The name of the security rule. +// - options - SecurityRulesClientGetOptions contains the optional parameters for the SecurityRulesClient.Get method. +func (client *SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientGetOptions) (SecurityRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, options) + if err != nil { + return SecurityRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, options *SecurityRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + if securityRuleName == "" { + return nil, errors.New("parameter securityRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityRuleName}", url.PathEscape(securityRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (SecurityRulesClientGetResponse, error) { + result := SecurityRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRule); err != nil { + return SecurityRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all security rules in a network security group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityGroupName - The name of the network security group. +// - options - SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.NewListPager method. +func (client *SecurityRulesClient) NewListPager(resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) *runtime.Pager[SecurityRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityRulesClientListResponse]{ + More: func(page SecurityRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityRulesClientListResponse) (SecurityRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkSecurityGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecurityRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkSecurityGroupName == "" { + return nil, errors.New("parameter networkSecurityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityGroupName}", url.PathEscape(networkSecurityGroupName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityRulesClient) listHandleResponse(resp *http.Response) (SecurityRulesClientListResponse, error) { + result := SecurityRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityRuleListResult); err != nil { + return SecurityRulesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceassociationlinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceassociationlinks_client.go new file mode 100644 index 00000000000..212fe807c2d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceassociationlinks_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ServiceAssociationLinksClient contains the methods for the ServiceAssociationLinks group. +// Don't use this type directly, use NewServiceAssociationLinksClient() instead. +type ServiceAssociationLinksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceAssociationLinksClient creates a new instance of ServiceAssociationLinksClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceAssociationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceAssociationLinksClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceAssociationLinksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceAssociationLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Gets a list of service association links for a subnet. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - options - ServiceAssociationLinksClientListOptions contains the optional parameters for the ServiceAssociationLinksClient.List +// method. +func (client *ServiceAssociationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ServiceAssociationLinksClientListOptions) (ServiceAssociationLinksClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) + if err != nil { + return ServiceAssociationLinksClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceAssociationLinksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceAssociationLinksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *ServiceAssociationLinksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServiceAssociationLinksClient) listHandleResponse(resp *http.Response) (ServiceAssociationLinksClientListResponse, error) { + result := ServiceAssociationLinksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceAssociationLinksListResult); err != nil { + return ServiceAssociationLinksClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicies_client.go new file mode 100644 index 00000000000..fa3fdf6398c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicies_client.go @@ -0,0 +1,426 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ServiceEndpointPoliciesClient contains the methods for the ServiceEndpointPolicies group. +// Don't use this type directly, use NewServiceEndpointPoliciesClient() instead. +type ServiceEndpointPoliciesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceEndpointPoliciesClient creates a new instance of ServiceEndpointPoliciesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceEndpointPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPoliciesClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceEndpointPoliciesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceEndpointPoliciesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a service Endpoint Policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - parameters - Parameters supplied to the create or update service endpoint policy operation. +// - options - ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate +// method. +func (client *ServiceEndpointPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceEndpointPoliciesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPoliciesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ServiceEndpointPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a service Endpoint Policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ServiceEndpointPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - options - ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete +// method. +func (client *ServiceEndpointPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*runtime.Poller[ServiceEndpointPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceEndpointPolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPoliciesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ServiceEndpointPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified service Endpoint Policies in a specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - options - ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get +// method. +func (client *ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientGetOptions) (ServiceEndpointPoliciesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) + if err != nil { + return ServiceEndpointPoliciesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPoliciesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientGetResponse, error) { + result := ServiceEndpointPoliciesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicy); err != nil { + return ServiceEndpointPoliciesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the service endpoint policies in a subscription. +// +// Generated from API version 2022-09-01 +// - options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager +// method. +func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPoliciesClientListResponse]{ + More: func(page ServiceEndpointPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceEndpointPoliciesClientListResponse) (ServiceEndpointPoliciesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceEndpointPoliciesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPoliciesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPoliciesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Context, options *ServiceEndpointPoliciesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientListResponse, error) { + result := ServiceEndpointPoliciesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyListResult); err != nil { + return ServiceEndpointPoliciesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager +// method. +func (client *ServiceEndpointPoliciesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPoliciesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPoliciesClientListByResourceGroupResponse]{ + More: func(page ServiceEndpointPoliciesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceEndpointPoliciesClientListByResourceGroupResponse) (ServiceEndpointPoliciesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ServiceEndpointPoliciesClient) listByResourceGroupHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientListByResourceGroupResponse, error) { + result := ServiceEndpointPoliciesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyListResult); err != nil { + return ServiceEndpointPoliciesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags of a service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - parameters - Parameters supplied to update service endpoint policy tags. +// - options - ServiceEndpointPoliciesClientUpdateTagsOptions contains the optional parameters for the ServiceEndpointPoliciesClient.UpdateTags +// method. +func (client *ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject, options *ServiceEndpointPoliciesClientUpdateTagsOptions) (ServiceEndpointPoliciesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, parameters, options) + if err != nil { + return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject, options *ServiceEndpointPoliciesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ServiceEndpointPoliciesClient) updateTagsHandleResponse(resp *http.Response) (ServiceEndpointPoliciesClientUpdateTagsResponse, error) { + result := ServiceEndpointPoliciesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicy); err != nil { + return ServiceEndpointPoliciesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicydefinitions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicydefinitions_client.go new file mode 100644 index 00000000000..1d2e4262b91 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/serviceendpointpolicydefinitions_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ServiceEndpointPolicyDefinitionsClient contains the methods for the ServiceEndpointPolicyDefinitions group. +// Don't use this type directly, use NewServiceEndpointPolicyDefinitionsClient() instead. +type ServiceEndpointPolicyDefinitionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceEndpointPolicyDefinitionsClient creates a new instance of ServiceEndpointPolicyDefinitionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceEndpointPolicyDefinitionsClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceEndpointPolicyDefinitionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceEndpointPolicyDefinitionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy. +// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. +// - serviceEndpointPolicyDefinitions - Parameters supplied to the create or update service endpoint policy operation. +// - options - ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate +// method. +func (client *ServiceEndpointPolicyDefinitionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ServiceEndpointPolicyDefinitionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a service endpoint policy definition in the specified service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + if serviceEndpointPolicyDefinitionName == "" { + return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions) +} + +// BeginDelete - Deletes the specified ServiceEndpoint policy definitions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the Service Endpoint Policy. +// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition. +// - options - ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete +// method. +func (client *ServiceEndpointPolicyDefinitionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*runtime.Poller[ServiceEndpointPolicyDefinitionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceEndpointPolicyDefinitionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ServiceEndpointPolicyDefinitionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified ServiceEndpoint policy definitions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + if serviceEndpointPolicyDefinitionName == "" { + return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the specified service endpoint policy definitions from service endpoint policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy name. +// - serviceEndpointPolicyDefinitionName - The name of the service endpoint policy definition name. +// - options - ServiceEndpointPolicyDefinitionsClientGetOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.Get +// method. +func (client *ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (ServiceEndpointPolicyDefinitionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) + if err != nil { + return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPolicyDefinitionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + if serviceEndpointPolicyDefinitionName == "" { + return nil, errors.New("parameter serviceEndpointPolicyDefinitionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyDefinitionName}", url.PathEscape(serviceEndpointPolicyDefinitionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *http.Response) (ServiceEndpointPolicyDefinitionsClientGetResponse, error) { + result := ServiceEndpointPolicyDefinitionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyDefinition); err != nil { + return ServiceEndpointPolicyDefinitionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - serviceEndpointPolicyName - The name of the service endpoint policy name. +// - options - ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager +// method. +func (client *ServiceEndpointPolicyDefinitionsClient) NewListByResourceGroupPager(resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) *runtime.Pager[ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse]{ + More: func(page ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse) (ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, serviceEndpointPolicyName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceEndpointPolicyName == "" { + return nil, errors.New("parameter serviceEndpointPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceEndpointPolicyName}", url.PathEscape(serviceEndpointPolicyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupHandleResponse(resp *http.Response) (ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse, error) { + result := ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceEndpointPolicyDefinitionListResult); err != nil { + return ServiceEndpointPolicyDefinitionsClientListByResourceGroupResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetaginformation_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetaginformation_client.go new file mode 100644 index 00000000000..ebf42933e96 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetaginformation_client.go @@ -0,0 +1,120 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ServiceTagInformationClient contains the methods for the ServiceTagInformation group. +// Don't use this type directly, use NewServiceTagInformationClient() instead. +type ServiceTagInformationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceTagInformationClient creates a new instance of ServiceTagInformationClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceTagInformationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagInformationClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceTagInformationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceTagInformationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets a list of service tag information resources with pagination. +// +// Generated from API version 2022-09-01 +// - location - The location that will be used as a reference for cloud (not as a filter based on location, you will get the +// list of service tags with prefix details across all regions but limited to the cloud that +// your subscription belongs to). +// - options - ServiceTagInformationClientListOptions contains the optional parameters for the ServiceTagInformationClient.NewListPager +// method. +func (client *ServiceTagInformationClient) NewListPager(location string, options *ServiceTagInformationClientListOptions) *runtime.Pager[ServiceTagInformationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceTagInformationClientListResponse]{ + More: func(page ServiceTagInformationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServiceTagInformationClientListResponse) (ServiceTagInformationClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServiceTagInformationClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceTagInformationClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceTagInformationClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagInformationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails" + 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", "2022-09-01") + if options != nil && options.NoAddressPrefixes != nil { + reqQP.Set("noAddressPrefixes", strconv.FormatBool(*options.NoAddressPrefixes)) + } + if options != nil && options.TagName != nil { + reqQP.Set("tagName", *options.TagName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServiceTagInformationClient) listHandleResponse(resp *http.Response) (ServiceTagInformationClientListResponse, error) { + result := ServiceTagInformationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTagInformationListResult); err != nil { + return ServiceTagInformationClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetags_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetags_client.go new file mode 100644 index 00000000000..e392ce7b373 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/servicetags_client.go @@ -0,0 +1,100 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// ServiceTagsClient contains the methods for the ServiceTags group. +// Don't use this type directly, use NewServiceTagsClient() instead. +type ServiceTagsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceTagsClient creates a new instance of ServiceTagsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTagsClient, error) { + cl, err := arm.NewClient(moduleName+".ServiceTagsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceTagsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// List - Gets a list of service tag information resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - location - The location that will be used as a reference for version (not as a filter based on location, you will get the +// list of service tags with prefix details across all regions but limited to the cloud that +// your subscription belongs to). +// - options - ServiceTagsClientListOptions contains the optional parameters for the ServiceTagsClient.List method. +func (client *ServiceTagsClient) List(ctx context.Context, location string, options *ServiceTagsClientListOptions) (ServiceTagsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, options) + if err != nil { + return ServiceTagsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceTagsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceTagsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServiceTagsClient) listHandleResponse(resp *http.Response) (ServiceTagsClientListResponse, error) { + result := ServiceTagsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTagsListResult); err != nil { + return ServiceTagsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/staticmembers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/staticmembers_client.go new file mode 100644 index 00000000000..a365bbbeb56 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/staticmembers_client.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// StaticMembersClient contains the methods for the StaticMembers group. +// Don't use this type directly, use NewStaticMembersClient() instead. +type StaticMembersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewStaticMembersClient creates a new instance of StaticMembersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewStaticMembersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StaticMembersClient, error) { + cl, err := arm.NewClient(moduleName+".StaticMembersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &StaticMembersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a static member. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - staticMemberName - The name of the static member. +// - parameters - Parameters supplied to the specify the static member to create +// - options - StaticMembersClientCreateOrUpdateOptions contains the optional parameters for the StaticMembersClient.CreateOrUpdate +// method. +func (client *StaticMembersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, options *StaticMembersClientCreateOrUpdateOptions) (StaticMembersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, parameters, options) + if err != nil { + return StaticMembersClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StaticMembersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return StaticMembersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, options *StaticMembersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + if staticMemberName == "" { + return nil, errors.New("parameter staticMemberName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *StaticMembersClient) createOrUpdateHandleResponse(resp *http.Response) (StaticMembersClientCreateOrUpdateResponse, error) { + result := StaticMembersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticMember); err != nil { + return StaticMembersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a static member. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - staticMemberName - The name of the static member. +// - options - StaticMembersClientDeleteOptions contains the optional parameters for the StaticMembersClient.Delete method. +func (client *StaticMembersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientDeleteOptions) (StaticMembersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, options) + if err != nil { + return StaticMembersClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StaticMembersClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return StaticMembersClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return StaticMembersClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + if staticMemberName == "" { + return nil, errors.New("parameter staticMemberName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified static member. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - staticMemberName - The name of the static member. +// - options - StaticMembersClientGetOptions contains the optional parameters for the StaticMembersClient.Get method. +func (client *StaticMembersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientGetOptions) (StaticMembersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, options) + if err != nil { + return StaticMembersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StaticMembersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticMembersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + if staticMemberName == "" { + return nil, errors.New("parameter staticMemberName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{staticMemberName}", url.PathEscape(staticMemberName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StaticMembersClient) getHandleResponse(resp *http.Response) (StaticMembersClientGetResponse, error) { + result := StaticMembersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticMember); err != nil { + return StaticMembersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the specified static member. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkManagerName - The name of the network manager. +// - networkGroupName - The name of the network group. +// - options - StaticMembersClientListOptions contains the optional parameters for the StaticMembersClient.NewListPager method. +func (client *StaticMembersClient) NewListPager(resourceGroupName string, networkManagerName string, networkGroupName string, options *StaticMembersClientListOptions) *runtime.Pager[StaticMembersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[StaticMembersClientListResponse]{ + More: func(page StaticMembersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StaticMembersClientListResponse) (StaticMembersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkManagerName, networkGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StaticMembersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StaticMembersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticMembersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *StaticMembersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *StaticMembersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers" + 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 networkManagerName == "" { + return nil, errors.New("parameter networkManagerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerName}", url.PathEscape(networkManagerName)) + if networkGroupName == "" { + return nil, errors.New("parameter networkGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkGroupName}", url.PathEscape(networkGroupName)) + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *StaticMembersClient) listHandleResponse(resp *http.Response) (StaticMembersClientListResponse, error) { + result := StaticMembersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticMemberListResult); err != nil { + return StaticMembersClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subnets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subnets_client.go new file mode 100644 index 00000000000..9824a5cf12b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subnets_client.go @@ -0,0 +1,470 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SubnetsClient contains the methods for the Subnets group. +// Don't use this type directly, use NewSubnetsClient() instead. +type SubnetsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSubnetsClient creates a new instance of SubnetsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSubnetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubnetsClient, error) { + cl, err := arm.NewClient(moduleName+".SubnetsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SubnetsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a subnet in the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - subnetParameters - Parameters supplied to the create or update subnet operation. +// - options - SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate +// method. +func (client *SubnetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SubnetsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SubnetsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a subnet in the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SubnetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, options *SubnetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, subnetParameters) +} + +// BeginDelete - Deletes the specified subnet. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - options - SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. +func (client *SubnetsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*runtime.Poller[SubnetsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, subnetName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SubnetsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified subnet. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SubnetsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified subnet by virtual network and resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - options - SubnetsClientGetOptions contains the optional parameters for the SubnetsClient.Get method. +func (client *SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientGetOptions) (SubnetsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, options) + if err != nil { + return SubnetsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubnetsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SubnetsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClientGetResponse, error) { + result := SubnetsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Subnet); err != nil { + return SubnetsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all subnets in a virtual network. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - SubnetsClientListOptions contains the optional parameters for the SubnetsClient.NewListPager method. +func (client *SubnetsClient) NewListPager(resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) *runtime.Pager[SubnetsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SubnetsClientListResponse]{ + More: func(page SubnetsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SubnetsClientListResponse) (SubnetsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SubnetsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubnetsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SubnetsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SubnetsClient) listHandleResponse(resp *http.Response) (SubnetsClientListResponse, error) { + result := SubnetsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SubnetListResult); err != nil { + return SubnetsClientListResponse{}, err + } + return result, nil +} + +// BeginPrepareNetworkPolicies - Prepares a subnet by applying network intent policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - prepareNetworkPoliciesRequestParameters - Parameters supplied to prepare subnet by applying network intent policies. +// - options - SubnetsClientBeginPrepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginPrepareNetworkPolicies +// method. +func (client *SubnetsClient) BeginPrepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*runtime.Poller[SubnetsClientPrepareNetworkPoliciesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.prepareNetworkPolicies(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientPrepareNetworkPoliciesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SubnetsClientPrepareNetworkPoliciesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// PrepareNetworkPolicies - Prepares a subnet by applying network intent policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SubnetsClient) prepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*http.Response, error) { + req, err := client.prepareNetworkPoliciesCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// prepareNetworkPoliciesCreateRequest creates the PrepareNetworkPolicies request. +func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters) +} + +// BeginUnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - subnetName - The name of the subnet. +// - unprepareNetworkPoliciesRequestParameters - Parameters supplied to unprepare subnet to remove network intent policies. +// - options - SubnetsClientBeginUnprepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginUnprepareNetworkPolicies +// method. +func (client *SubnetsClient) BeginUnprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*runtime.Poller[SubnetsClientUnprepareNetworkPoliciesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.unprepareNetworkPolicies(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubnetsClientUnprepareNetworkPoliciesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SubnetsClientUnprepareNetworkPoliciesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UnprepareNetworkPolicies - Unprepares a subnet by removing network intent policies. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *SubnetsClient) unprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*http.Response, error) { + req, err := client.unprepareNetworkPoliciesCreateRequest(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// unprepareNetworkPoliciesCreateRequest creates the UnprepareNetworkPolicies request. +func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if subnetName == "" { + return nil, errors.New("parameter subnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subnetName}", url.PathEscape(subnetName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, unprepareNetworkPoliciesRequestParameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subscriptionnetworkmanagerconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subscriptionnetworkmanagerconnections_client.go new file mode 100644 index 00000000000..ad1409b867b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/subscriptionnetworkmanagerconnections_client.go @@ -0,0 +1,264 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// SubscriptionNetworkManagerConnectionsClient contains the methods for the SubscriptionNetworkManagerConnections group. +// Don't use this type directly, use NewSubscriptionNetworkManagerConnectionsClient() instead. +type SubscriptionNetworkManagerConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSubscriptionNetworkManagerConnectionsClient creates a new instance of SubscriptionNetworkManagerConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionNetworkManagerConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".SubscriptionNetworkManagerConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SubscriptionNetworkManagerConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create a network manager connection on this subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - networkManagerConnectionName - Name for the network manager connection. +// - parameters - Network manager connection to be created/updated. +// - options - SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate +// method. +func (client *SubscriptionNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, options *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, networkManagerConnectionName, parameters, options) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, options *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse, error) { + result := SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { + return SubscriptionNetworkManagerConnectionsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete specified connection created by this subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - networkManagerConnectionName - Name for the network manager connection. +// - options - SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete +// method. +func (client *SubscriptionNetworkManagerConnectionsClient) Delete(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (SubscriptionNetworkManagerConnectionsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, networkManagerConnectionName, options) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SubscriptionNetworkManagerConnectionsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a specified connection created by this subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - networkManagerConnectionName - Name for the network manager connection. +// - options - SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get +// method. +func (client *SubscriptionNetworkManagerConnectionsClient) Get(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientGetOptions) (SubscriptionNetworkManagerConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, networkManagerConnectionName, options) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SubscriptionNetworkManagerConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkManagerConnectionName == "" { + return nil, errors.New("parameter networkManagerConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkManagerConnectionName}", url.PathEscape(networkManagerConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SubscriptionNetworkManagerConnectionsClient) getHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientGetResponse, error) { + result := SubscriptionNetworkManagerConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnection); err != nil { + return SubscriptionNetworkManagerConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all network manager connections created by this subscription. +// +// Generated from API version 2022-09-01 +// - options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager +// method. +func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SubscriptionNetworkManagerConnectionsClientListResponse]{ + More: func(page SubscriptionNetworkManagerConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SubscriptionNetworkManagerConnectionsClientListResponse) (SubscriptionNetworkManagerConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SubscriptionNetworkManagerConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SubscriptionNetworkManagerConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SubscriptionNetworkManagerConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx context.Context, options *SubscriptionNetworkManagerConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections" + 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", "2022-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SubscriptionNetworkManagerConnectionsClient) listHandleResponse(resp *http.Response) (SubscriptionNetworkManagerConnectionsClientListResponse, error) { + result := SubscriptionNetworkManagerConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagerConnectionListResult); err != nil { + return SubscriptionNetworkManagerConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/time_rfc3339.go new file mode 100644 index 00000000000..6da2de17a36 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/time_rfc3339.go @@ -0,0 +1,87 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// 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+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} + +func populateTimeRFC3339(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] = (*timeRFC3339)(t) +} + +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux timeRFC3339 + 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/network/armnetwork/v2/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/usages_client.go new file mode 100644 index 00000000000..5b9e56549b8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/usages_client.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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 subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - 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+".UsagesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &UsagesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List network usages for a subscription. +// +// Generated from API version 2022-09-01 +// - location - The location where resource usage is queried. +// - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. +func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[UsagesClientListResponse]{ + More: func(page UsagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *UsagesClientListResponse) (UsagesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UsagesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UsagesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UsagesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *UsagesClient) listHandleResponse(resp *http.Response) (UsagesClientListResponse, error) { + result := UsagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UsagesListResult); err != nil { + return UsagesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vipswap_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vipswap_client.go new file mode 100644 index 00000000000..564968e0d1a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vipswap_client.go @@ -0,0 +1,229 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VipSwapClient contains the methods for the VipSwap group. +// Don't use this type directly, use NewVipSwapClient() instead. +type VipSwapClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVipSwapClient creates a new instance of VipSwapClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVipSwapClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VipSwapClient, error) { + cl, err := arm.NewClient(moduleName+".VipSwapClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VipSwapClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Performs vip swap operation on swappable cloud services. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - groupName - The name of the resource group. +// - resourceName - The name of the cloud service. +// - parameters - SwapResource object where slot type should be the target slot after vip swap for the specified cloud service. +// - options - VipSwapClientBeginCreateOptions contains the optional parameters for the VipSwapClient.BeginCreate method. +func (client *VipSwapClient) BeginCreate(ctx context.Context, groupName string, resourceName string, parameters SwapResource, options *VipSwapClientBeginCreateOptions) (*runtime.Poller[VipSwapClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, groupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[VipSwapClientCreateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[VipSwapClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Performs vip swap operation on swappable cloud services. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VipSwapClient) create(ctx context.Context, groupName string, resourceName string, parameters SwapResource, options *VipSwapClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, groupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName string, resourceName string, parameters SwapResource, options *VipSwapClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + urlPath = strings.ReplaceAll(urlPath, "{singletonResource}", url.PathEscape("swap")) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud service +// can either be Staging or Production +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - groupName - The name of the resource group. +// - resourceName - The name of the cloud service. +// - options - VipSwapClientGetOptions contains the optional parameters for the VipSwapClient.Get method. +func (client *VipSwapClient) Get(ctx context.Context, groupName string, resourceName string, options *VipSwapClientGetOptions) (VipSwapClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, groupName, resourceName, options) + if err != nil { + return VipSwapClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VipSwapClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VipSwapClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName string, resourceName string, options *VipSwapClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}" + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + urlPath = strings.ReplaceAll(urlPath, "{singletonResource}", url.PathEscape("swap")) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VipSwapClient) getHandleResponse(resp *http.Response) (VipSwapClientGetResponse, error) { + result := VipSwapClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SwapResource); err != nil { + return VipSwapClientGetResponse{}, err + } + return result, nil +} + +// List - Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a +// cloud service can either be Staging or Production +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - groupName - The name of the resource group. +// - resourceName - The name of the cloud service. +// - options - VipSwapClientListOptions contains the optional parameters for the VipSwapClient.List method. +func (client *VipSwapClient) List(ctx context.Context, groupName string, resourceName string, options *VipSwapClientListOptions) (VipSwapClientListResponse, error) { + req, err := client.listCreateRequest(ctx, groupName, resourceName, options) + if err != nil { + return VipSwapClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VipSwapClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VipSwapClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName string, resourceName string, options *VipSwapClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots" + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VipSwapClient) listHandleResponse(resp *http.Response) (VipSwapClientListResponse, error) { + result := VipSwapClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SwapResourceListResult); err != nil { + return VipSwapClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliances_client.go new file mode 100644 index 00000000000..a4446e1e575 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliances_client.go @@ -0,0 +1,425 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualAppliancesClient contains the methods for the NetworkVirtualAppliances group. +// Don't use this type directly, use NewVirtualAppliancesClient() instead. +type VirtualAppliancesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualAppliancesClient creates a new instance of VirtualAppliancesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualAppliancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualAppliancesClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualAppliancesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualAppliancesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - parameters - Parameters supplied to the create or update Network Virtual Appliance. +// - options - VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate +// method. +func (client *VirtualAppliancesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualAppliancesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualAppliancesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - options - VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete +// method. +func (client *VirtualAppliancesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*runtime.Poller[VirtualAppliancesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualAppliancesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - options - VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. +func (client *VirtualAppliancesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (VirtualAppliancesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return VirtualAppliancesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualAppliancesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualAppliancesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (VirtualAppliancesClientGetResponse, error) { + result := VirtualAppliancesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualAppliance); err != nil { + return VirtualAppliancesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all Network Virtual Appliances in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager +// method. +func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualAppliancesClientListResponse]{ + More: func(page VirtualAppliancesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualAppliancesClientListResponse) (VirtualAppliancesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualAppliancesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualAppliancesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualAppliancesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, options *VirtualAppliancesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) (VirtualAppliancesClientListResponse, error) { + result := VirtualAppliancesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceListResult); err != nil { + return VirtualAppliancesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager +// method. +func (client *VirtualAppliancesClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) *runtime.Pager[VirtualAppliancesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualAppliancesClientListByResourceGroupResponse]{ + More: func(page VirtualAppliancesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualAppliancesClientListByResourceGroupResponse) (VirtualAppliancesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualAppliancesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualAppliancesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualAppliancesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualAppliancesClientListByResourceGroupResponse, error) { + result := VirtualAppliancesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceListResult); err != nil { + return VirtualAppliancesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a Network Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of Network Virtual Appliance. +// - networkVirtualApplianceName - The name of Network Virtual Appliance being updated. +// - parameters - Parameters supplied to Update Network Virtual Appliance Tags. +// - options - VirtualAppliancesClientUpdateTagsOptions contains the optional parameters for the VirtualAppliancesClient.UpdateTags +// method. +func (client *VirtualAppliancesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, options *VirtualAppliancesClientUpdateTagsOptions) (VirtualAppliancesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, parameters, options) + if err != nil { + return VirtualAppliancesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualAppliancesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualAppliancesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, options *VirtualAppliancesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}" + 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 networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VirtualAppliancesClient) updateTagsHandleResponse(resp *http.Response) (VirtualAppliancesClientUpdateTagsResponse, error) { + result := VirtualAppliancesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualAppliance); err != nil { + return VirtualAppliancesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliancesites_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliancesites_client.go new file mode 100644 index 00000000000..64032cd48ca --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualappliancesites_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualApplianceSitesClient contains the methods for the VirtualApplianceSites group. +// Don't use this type directly, use NewVirtualApplianceSitesClient() instead. +type VirtualApplianceSitesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualApplianceSitesClient creates a new instance of VirtualApplianceSitesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualApplianceSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSitesClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualApplianceSitesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualApplianceSitesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - siteName - The name of the site. +// - parameters - Parameters supplied to the create or update Network Virtual Appliance Site operation. +// - options - VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate +// method. +func (client *VirtualApplianceSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualApplianceSitesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceSitesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualApplianceSitesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Network Virtual Appliance Site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualApplianceSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified site from a Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - siteName - The name of the site. +// - options - VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete +// method. +func (client *VirtualApplianceSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*runtime.Poller[VirtualApplianceSitesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualApplianceSitesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualApplianceSitesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified site from a Virtual Appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualApplianceSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Virtual Appliance Site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - siteName - The name of the site. +// - options - VirtualApplianceSitesClientGetOptions contains the optional parameters for the VirtualApplianceSitesClient.Get +// method. +func (client *VirtualApplianceSitesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientGetOptions) (VirtualApplianceSitesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, siteName, options) + if err != nil { + return VirtualApplianceSitesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualApplianceSitesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualApplianceSitesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, options *VirtualApplianceSitesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualApplianceSitesClient) getHandleResponse(resp *http.Response) (VirtualApplianceSitesClientGetResponse, error) { + result := VirtualApplianceSitesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSite); err != nil { + return VirtualApplianceSitesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of the Network Virtual Appliance. +// - options - VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.NewListPager +// method. +func (client *VirtualApplianceSitesClient) NewListPager(resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) *runtime.Pager[VirtualApplianceSitesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualApplianceSitesClientListResponse]{ + More: func(page VirtualApplianceSitesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualApplianceSitesClientListResponse) (VirtualApplianceSitesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualApplianceSitesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualApplianceSitesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualApplianceSitesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + return nil, errors.New("parameter networkVirtualApplianceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkVirtualApplianceName}", url.PathEscape(networkVirtualApplianceName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualApplianceSitesClient) listHandleResponse(resp *http.Response) (VirtualApplianceSitesClientListResponse, error) { + result := VirtualApplianceSitesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSiteListResult); err != nil { + return VirtualApplianceSitesClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualapplianceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualapplianceskus_client.go new file mode 100644 index 00000000000..4326d7f0892 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualapplianceskus_client.go @@ -0,0 +1,159 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualApplianceSKUsClient contains the methods for the VirtualApplianceSKUs group. +// Don't use this type directly, use NewVirtualApplianceSKUsClient() instead. +type VirtualApplianceSKUsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualApplianceSKUsClient creates a new instance of VirtualApplianceSKUsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualApplianceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualApplianceSKUsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualApplianceSKUsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualApplianceSKUsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieves a single available sku for network virtual appliance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - skuName - Name of the Sku. +// - options - VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get +// method. +func (client *VirtualApplianceSKUsClient) Get(ctx context.Context, skuName string, options *VirtualApplianceSKUsClientGetOptions) (VirtualApplianceSKUsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, skuName, options) + if err != nil { + return VirtualApplianceSKUsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualApplianceSKUsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualApplianceSKUsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, skuName string, options *VirtualApplianceSKUsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if skuName == "" { + return nil, errors.New("parameter skuName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualApplianceSKUsClient) getHandleResponse(resp *http.Response) (VirtualApplianceSKUsClientGetResponse, error) { + result := VirtualApplianceSKUsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSKU); err != nil { + return VirtualApplianceSKUsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all SKUs available for a virtual appliance. +// +// Generated from API version 2022-09-01 +// - options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager +// method. +func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualApplianceSKUsClientListResponse]{ + More: func(page VirtualApplianceSKUsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualApplianceSKUsClientListResponse) (VirtualApplianceSKUsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualApplianceSKUsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualApplianceSKUsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualApplianceSKUsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, options *VirtualApplianceSKUsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualApplianceSKUsClient) listHandleResponse(resp *http.Response) (VirtualApplianceSKUsClientListResponse, error) { + result := VirtualApplianceSKUsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualApplianceSKUListResult); err != nil { + return VirtualApplianceSKUsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnection_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnection_client.go new file mode 100644 index 00000000000..baaf53b500f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnection_client.go @@ -0,0 +1,254 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualHubBgpConnectionClient contains the methods for the VirtualHubBgpConnection group. +// Don't use this type directly, use NewVirtualHubBgpConnectionClient() instead. +type VirtualHubBgpConnectionClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualHubBgpConnectionClient creates a new instance of VirtualHubBgpConnectionClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualHubBgpConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualHubBgpConnectionClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualHubBgpConnectionClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the connection. +// - parameters - Parameters of Bgp connection. +// - options - VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginCreateOrUpdate +// method. +func (client *VirtualHubBgpConnectionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubBgpConnectionClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, connectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubBgpConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes a VirtualHubBgpConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHubBgpConnection. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the connection. +// - options - VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete +// method. +func (client *VirtualHubBgpConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*runtime.Poller[VirtualHubBgpConnectionClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VirtualHubBgpConnection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubBgpConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a Virtual Hub Bgp Connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - connectionName - The name of the connection. +// - options - VirtualHubBgpConnectionClientGetOptions contains the optional parameters for the VirtualHubBgpConnectionClient.Get +// method. +func (client *VirtualHubBgpConnectionClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientGetOptions) (VirtualHubBgpConnectionClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, connectionName, options) + if err != nil { + return VirtualHubBgpConnectionClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubBgpConnectionClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubBgpConnectionClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualHubBgpConnectionClient) getHandleResponse(resp *http.Response) (VirtualHubBgpConnectionClientGetResponse, error) { + result := VirtualHubBgpConnectionClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BgpConnection); err != nil { + return VirtualHubBgpConnectionClientGetResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnections_client.go new file mode 100644 index 00000000000..d9d42dae901 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubbgpconnections_client.go @@ -0,0 +1,260 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualHubBgpConnectionsClient contains the methods for the VirtualHubBgpConnections group. +// Don't use this type directly, use NewVirtualHubBgpConnectionsClient() instead. +type VirtualHubBgpConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualHubBgpConnectionsClient creates a new instance of VirtualHubBgpConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubBgpConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualHubBgpConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualHubBgpConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Retrieves the details of all VirtualHubBgpConnections. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.NewListPager +// method. +func (client *VirtualHubBgpConnectionsClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubBgpConnectionsClientListOptions) *runtime.Pager[VirtualHubBgpConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualHubBgpConnectionsClientListResponse]{ + More: func(page VirtualHubBgpConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualHubBgpConnectionsClientListResponse) (VirtualHubBgpConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualHubBgpConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubBgpConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubBgpConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubBgpConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualHubBgpConnectionsClient) listHandleResponse(resp *http.Response) (VirtualHubBgpConnectionsClientListResponse, error) { + result := VirtualHubBgpConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubBgpConnectionResults); err != nil { + return VirtualHubBgpConnectionsClientListResponse{}, err + } + return result, nil +} + +// BeginListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - hubName - The name of the virtual hub. +// - connectionName - The name of the virtual hub bgp connection. +// - options - VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes +// method. +func (client *VirtualHubBgpConnectionsClient) BeginListAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listAdvertisedRoutes(ctx, resourceGroupName, hubName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListAdvertisedRoutes - Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*http.Response, error) { + req, err := client.listAdvertisedRoutesCreateRequest(ctx, resourceGroupName, hubName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listAdvertisedRoutesCreateRequest creates the ListAdvertisedRoutes request. +func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hubName == "" { + return nil, errors.New("parameter hubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - hubName - The name of the virtual hub. +// - connectionName - The name of the virtual hub bgp connection. +// - options - VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes +// method. +func (client *VirtualHubBgpConnectionsClient) BeginListLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*runtime.Poller[VirtualHubBgpConnectionsClientListLearnedRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listLearnedRoutes(ctx, resourceGroupName, hubName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubBgpConnectionsClientListLearnedRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubBgpConnectionsClientListLearnedRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListLearnedRoutes - Retrieves a list of routes the virtual hub bgp connection has learned. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubBgpConnectionsClient) listLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*http.Response, error) { + req, err := client.listLearnedRoutesCreateRequest(ctx, resourceGroupName, hubName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listLearnedRoutesCreateRequest creates the ListLearnedRoutes request. +func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, hubName string, connectionName string, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hubName == "" { + return nil, errors.New("parameter hubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hubName}", url.PathEscape(hubName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-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/network/armnetwork/v2/virtualhubipconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubipconfiguration_client.go new file mode 100644 index 00000000000..e1637e783ad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubipconfiguration_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualHubIPConfigurationClient contains the methods for the VirtualHubIPConfiguration group. +// Don't use this type directly, use NewVirtualHubIPConfigurationClient() instead. +type VirtualHubIPConfigurationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualHubIPConfigurationClient creates a new instance of VirtualHubIPConfigurationClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualHubIPConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubIPConfigurationClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualHubIPConfigurationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualHubIPConfigurationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - ipConfigName - The name of the ipconfig. +// - parameters - Hub Ip Configuration parameters. +// - options - VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate +// method. +func (client *VirtualHubIPConfigurationClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubIPConfigurationClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, ipConfigName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubIPConfigurationClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubIPConfigurationClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubIPConfigurationClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if ipConfigName == "" { + return nil, errors.New("parameter ipConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes a VirtualHubIpConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHubBgpConnection. +// - virtualHubName - The name of the VirtualHub. +// - ipConfigName - The name of the ipconfig. +// - options - VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete +// method. +func (client *VirtualHubIPConfigurationClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*runtime.Poller[VirtualHubIPConfigurationClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, ipConfigName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubIPConfigurationClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubIPConfigurationClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VirtualHubIpConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubIPConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if ipConfigName == "" { + return nil, errors.New("parameter ipConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a Virtual Hub Ip configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - ipConfigName - The name of the ipconfig. +// - options - VirtualHubIPConfigurationClientGetOptions contains the optional parameters for the VirtualHubIPConfigurationClient.Get +// method. +func (client *VirtualHubIPConfigurationClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (VirtualHubIPConfigurationClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, ipConfigName, options) + if err != nil { + return VirtualHubIPConfigurationClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubIPConfigurationClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubIPConfigurationClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if ipConfigName == "" { + return nil, errors.New("parameter ipConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ipConfigName}", url.PathEscape(ipConfigName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Response) (VirtualHubIPConfigurationClientGetResponse, error) { + result := VirtualHubIPConfigurationClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HubIPConfiguration); err != nil { + return VirtualHubIPConfigurationClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all VirtualHubIpConfigurations. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.NewListPager +// method. +func (client *VirtualHubIPConfigurationClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubIPConfigurationClientListOptions) *runtime.Pager[VirtualHubIPConfigurationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualHubIPConfigurationClientListResponse]{ + More: func(page VirtualHubIPConfigurationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualHubIPConfigurationClientListResponse) (VirtualHubIPConfigurationClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualHubIPConfigurationClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubIPConfigurationClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubIPConfigurationClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubIPConfigurationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualHubIPConfigurationClient) listHandleResponse(resp *http.Response) (VirtualHubIPConfigurationClientListResponse, error) { + result := VirtualHubIPConfigurationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubIPConfigurationResults); err != nil { + return VirtualHubIPConfigurationClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubroutetablev2s_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubroutetablev2s_client.go new file mode 100644 index 00000000000..a21b863bfe7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubroutetablev2s_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualHubRouteTableV2SClient contains the methods for the VirtualHubRouteTableV2S group. +// Don't use this type directly, use NewVirtualHubRouteTableV2SClient() instead. +type VirtualHubRouteTableV2SClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualHubRouteTableV2SClient creates a new instance of VirtualHubRouteTableV2SClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualHubRouteTableV2SClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubRouteTableV2SClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualHubRouteTableV2SClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualHubRouteTableV2SClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the VirtualHubRouteTableV2. +// - virtualHubRouteTableV2Parameters - Parameters supplied to create or update VirtualHubRouteTableV2. +// - options - VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate +// method. +func (client *VirtualHubRouteTableV2SClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubRouteTableV2SClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubRouteTableV2SClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubRouteTableV2SClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubRouteTableV2SClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters) +} + +// BeginDelete - Deletes a VirtualHubRouteTableV2. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the VirtualHubRouteTableV2. +// - options - VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete +// method. +func (client *VirtualHubRouteTableV2SClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*runtime.Poller[VirtualHubRouteTableV2SClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubRouteTableV2SClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubRouteTableV2SClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VirtualHubRouteTableV2. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubRouteTableV2SClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a VirtualHubRouteTableV2. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. +// - virtualHubName - The name of the VirtualHub. +// - routeTableName - The name of the VirtualHubRouteTableV2. +// - options - VirtualHubRouteTableV2SClientGetOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.Get +// method. +func (client *VirtualHubRouteTableV2SClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientGetOptions) (VirtualHubRouteTableV2SClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, routeTableName, options) + if err != nil { + return VirtualHubRouteTableV2SClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubRouteTableV2SClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubRouteTableV2SClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + if routeTableName == "" { + return nil, errors.New("parameter routeTableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeTableName}", url.PathEscape(routeTableName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Response) (VirtualHubRouteTableV2SClientGetResponse, error) { + result := VirtualHubRouteTableV2SClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHubRouteTableV2); err != nil { + return VirtualHubRouteTableV2SClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.NewListPager +// method. +func (client *VirtualHubRouteTableV2SClient) NewListPager(resourceGroupName string, virtualHubName string, options *VirtualHubRouteTableV2SClientListOptions) *runtime.Pager[VirtualHubRouteTableV2SClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualHubRouteTableV2SClientListResponse]{ + More: func(page VirtualHubRouteTableV2SClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualHubRouteTableV2SClientListResponse) (VirtualHubRouteTableV2SClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualHubName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualHubRouteTableV2SClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubRouteTableV2SClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubRouteTableV2SClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubRouteTableV2SClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualHubRouteTableV2SClient) listHandleResponse(resp *http.Response) (VirtualHubRouteTableV2SClientListResponse, error) { + result := VirtualHubRouteTableV2SClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubRouteTableV2SResult); err != nil { + return VirtualHubRouteTableV2SClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubs_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubs_client.go new file mode 100644 index 00000000000..b3b84857f3b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualhubs_client.go @@ -0,0 +1,627 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualHubsClient contains the methods for the VirtualHubs group. +// Don't use this type directly, use NewVirtualHubsClient() instead. +type VirtualHubsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualHubsClient creates a new instance of VirtualHubsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualHubsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualHubsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualHubsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualHubsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - virtualHubParameters - Parameters supplied to create or update VirtualHub. +// - options - VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate +// method. +func (client *VirtualHubsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualHubsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, virtualHubParameters) +} + +// BeginDelete - Deletes a VirtualHub. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. +func (client *VirtualHubsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*runtime.Poller[VirtualHubsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualHubName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VirtualHub. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualHubName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a VirtualHub. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. +func (client *VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (VirtualHubsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualHubName, options) + if err != nil { + return VirtualHubsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (VirtualHubsClientGetResponse, error) { + result := VirtualHubsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHub); err != nil { + return VirtualHubsClientGetResponse{}, err + } + return result, nil +} + +// BeginGetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified +// resource . +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - options - VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes +// method. +func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*runtime.Poller[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getEffectiveVirtualHubRoutes(ctx, resourceGroupName, virtualHubName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubsClientGetEffectiveVirtualHubRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetEffectiveVirtualHubRoutes - Gets the effective routes configured for the Virtual Hub resource or the specified resource +// . +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { + req, err := client.getEffectiveVirtualHubRoutesCreateRequest(ctx, resourceGroupName, virtualHubName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getEffectiveVirtualHubRoutesCreateRequest creates the GetEffectiveVirtualHubRoutes request. +func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.EffectiveRoutesParameters != nil { + return req, runtime.MarshalAsJSON(req, *options.EffectiveRoutesParameters) + } + return req, nil +} + +// BeginGetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - getInboundRoutesParameters - Parameters supplied to get the inbound routes for a connection resource. +// - options - VirtualHubsClientBeginGetInboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetInboundRoutes +// method. +func (client *VirtualHubsClient) BeginGetInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*runtime.Poller[VirtualHubsClientGetInboundRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getInboundRoutes(ctx, resourceGroupName, virtualHubName, getInboundRoutesParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetInboundRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubsClientGetInboundRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetInboundRoutes - Gets the inbound routes configured for the Virtual Hub on a particular connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubsClient) getInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*http.Response, error) { + req, err := client.getInboundRoutesCreateRequest(ctx, resourceGroupName, virtualHubName, getInboundRoutesParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getInboundRoutesCreateRequest creates the GetInboundRoutes request. +func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, getInboundRoutesParameters) +} + +// BeginGetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - getOutboundRoutesParameters - Parameters supplied to get the outbound routes for a connection resource. +// - options - VirtualHubsClientBeginGetOutboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetOutboundRoutes +// method. +func (client *VirtualHubsClient) BeginGetOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*runtime.Poller[VirtualHubsClientGetOutboundRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getOutboundRoutes(ctx, resourceGroupName, virtualHubName, getOutboundRoutesParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualHubsClientGetOutboundRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualHubsClientGetOutboundRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetOutboundRoutes - Gets the outbound routes configured for the Virtual Hub on a particular connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualHubsClient) getOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*http.Response, error) { + req, err := client.getOutboundRoutesCreateRequest(ctx, resourceGroupName, virtualHubName, getOutboundRoutesParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getOutboundRoutesCreateRequest creates the GetOutboundRoutes request. +func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, getOutboundRoutesParameters) +} + +// NewListPager - Lists all the VirtualHubs in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualHubsClientListOptions contains the optional parameters for the VirtualHubsClient.NewListPager method. +func (client *VirtualHubsClient) NewListPager(options *VirtualHubsClientListOptions) *runtime.Pager[VirtualHubsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListResponse]{ + More: func(page VirtualHubsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualHubsClientListResponse) (VirtualHubsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualHubsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options *VirtualHubsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (VirtualHubsClientListResponse, error) { + result := VirtualHubsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubsResult); err != nil { + return VirtualHubsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager +// method. +func (client *VirtualHubsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) *runtime.Pager[VirtualHubsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualHubsClientListByResourceGroupResponse]{ + More: func(page VirtualHubsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualHubsClientListByResourceGroupResponse) (VirtualHubsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualHubsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VirtualHubsClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualHubsClientListByResourceGroupResponse, error) { + result := VirtualHubsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualHubsResult); err != nil { + return VirtualHubsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates VirtualHub tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualHub. +// - virtualHubName - The name of the VirtualHub. +// - virtualHubParameters - Parameters supplied to update VirtualHub tags. +// - options - VirtualHubsClientUpdateTagsOptions contains the optional parameters for the VirtualHubsClient.UpdateTags method. +func (client *VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, options *VirtualHubsClientUpdateTagsOptions) (VirtualHubsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualHubName, virtualHubParameters, options) + if err != nil { + return VirtualHubsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualHubsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualHubsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, options *VirtualHubsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" + 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 virtualHubName == "" { + return nil, errors.New("parameter virtualHubName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualHubName}", url.PathEscape(virtualHubName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, virtualHubParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VirtualHubsClient) updateTagsHandleResponse(resp *http.Response) (VirtualHubsClientUpdateTagsResponse, error) { + result := VirtualHubsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualHub); err != nil { + return VirtualHubsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewayconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewayconnections_client.go new file mode 100644 index 00000000000..c80bc83b74d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewayconnections_client.go @@ -0,0 +1,850 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworkGatewayConnectionsClient contains the methods for the VirtualNetworkGatewayConnections group. +// Don't use this type directly, use NewVirtualNetworkGatewayConnectionsClient() instead. +type VirtualNetworkGatewayConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworkGatewayConnectionsClient creates a new instance of VirtualNetworkGatewayConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworkGatewayConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworkGatewayConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. +// - parameters - Parameters supplied to the create or update virtual network gateway connection operation. +// - options - VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified virtual network Gateway connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. +// - options - VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified virtual network Gateway connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified virtual network gateway connection by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. +// - options - VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get +// method. +func (client *VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetOptions) (VirtualNetworkGatewayConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return VirtualNetworkGatewayConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewayConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewayConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworkGatewayConnectionsClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientGetResponse, error) { + result := VirtualNetworkGatewayConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayConnection); err != nil { + return VirtualNetworkGatewayConnectionsClientGetResponse{}, err + } + return result, nil +} + +// BeginGetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - options - VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginGetIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getIkeSas(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientGetIkeSasResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetIkeSas - Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { + req, err := client.getIkeSasCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getIkeSasCreateRequest creates the GetIkeSas request. +func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GetSharedKey - The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual +// network gateway connection shared key through Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The virtual network gateway connection shared key name. +// - options - VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey +// method. +func (client *VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse, error) { + req, err := client.getSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, runtime.NewResponseError(resp) + } + return client.getSharedKeyHandleResponse(resp) +} + +// getSharedKeyCreateRequest creates the GetSharedKey request. +func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getSharedKeyHandleResponse handles the GetSharedKey response. +func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse, error) { + result := VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionSharedKey); err != nil { + return VirtualNetworkGatewayConnectionsClientGetSharedKeyResponse{}, err + } + return result, nil +} + +// NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections +// created. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager +// method. +func (client *VirtualNetworkGatewayConnectionsClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) *runtime.Pager[VirtualNetworkGatewayConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewayConnectionsClientListResponse]{ + More: func(page VirtualNetworkGatewayConnectionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkGatewayConnectionsClientListResponse) (VirtualNetworkGatewayConnectionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkGatewayConnectionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewayConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewayConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualNetworkGatewayConnectionsClient) listHandleResponse(resp *http.Response) (VirtualNetworkGatewayConnectionsClientListResponse, error) { + result := VirtualNetworkGatewayConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayConnectionListResult); err != nil { + return VirtualNetworkGatewayConnectionsClientListResponse{}, err + } + return result, nil +} + +// BeginResetConnection - Resets the virtual network gateway connection specified. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - options - VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginResetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientResetConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetConnection(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetConnectionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientResetConnectionResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ResetConnection - Resets the virtual network gateway connection specified. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { + req, err := client.resetConnectionCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetConnectionCreateRequest creates the ResetConnection request. +func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection +// shared key for passed virtual network gateway connection in the specified resource group +// through Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The virtual network gateway connection reset shared key Name. +// - parameters - Parameters supplied to the begin reset virtual network gateway connection shared key operation through network +// resource provider. +// - options - VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetSharedKey(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientResetSharedKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ResetSharedKey - The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection +// shared key for passed virtual network gateway connection in the specified resource group +// through Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*http.Response, error) { + req, err := client.resetSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetSharedKeyCreateRequest creates the ResetSharedKey request. +func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginSetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection +// shared key for passed virtual network gateway connection in the specified resource group through +// Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The virtual network gateway connection name. +// - parameters - Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork +// resource provider. +// - options - VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.setSharedKey(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientSetSharedKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// SetSharedKey - The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared +// key for passed virtual network gateway connection in the specified resource group through +// Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) setSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*http.Response, error) { + req, err := client.setSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// setSharedKeyCreateRequest creates the SetSharedKey request. +func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginStartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. +// - options - VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the +// VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StartPacketCapture - Starts packet capture on virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { + req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startPacketCaptureCreateRequest creates the StartPacketCapture request. +func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// BeginStopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. +// - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection. +// - options - VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the +// VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StopPacketCapture - Stops packet capture on virtual network gateway connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { + req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopPacketCaptureCreateRequest creates the StopPacketCapture request. +func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginUpdateTags - Updates a virtual network gateway connection tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. +// - parameters - Parameters supplied to update virtual network gateway connection tags. +// - options - VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags +// method. +func (client *VirtualNetworkGatewayConnectionsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*runtime.Poller[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayConnectionsClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates a virtual network gateway connection tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayConnectionsClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewaynatrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewaynatrules_client.go new file mode 100644 index 00000000000..67293b92046 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgatewaynatrules_client.go @@ -0,0 +1,326 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworkGatewayNatRulesClient contains the methods for the VirtualNetworkGatewayNatRules group. +// Don't use this type directly, use NewVirtualNetworkGatewayNatRulesClient() instead. +type VirtualNetworkGatewayNatRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworkGatewayNatRulesClient creates a new instance of VirtualNetworkGatewayNatRulesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewayNatRulesClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworkGatewayNatRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworkGatewayNatRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing +// nat rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the Virtual Network Gateway. +// - virtualNetworkGatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - natRuleParameters - Parameters supplied to create or Update a Nat Rule. +// - options - VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayNatRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing +// nat rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" + 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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, natRuleParameters) +} + +// BeginDelete - Deletes a nat rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the Virtual Network Gateway. +// - virtualNetworkGatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - options - VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete +// method. +func (client *VirtualNetworkGatewayNatRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewayNatRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewayNatRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewayNatRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a nat rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewayNatRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" + 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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a nat rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the Virtual Network Gateway. +// - virtualNetworkGatewayName - The name of the gateway. +// - natRuleName - The name of the nat rule. +// - options - VirtualNetworkGatewayNatRulesClientGetOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.Get +// method. +func (client *VirtualNetworkGatewayNatRulesClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (VirtualNetworkGatewayNatRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, options) + if err != nil { + return VirtualNetworkGatewayNatRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewayNatRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewayNatRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" + 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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + if natRuleName == "" { + return nil, errors.New("parameter natRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{natRuleName}", url.PathEscape(natRuleName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewayNatRulesClientGetResponse, error) { + result := VirtualNetworkGatewayNatRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayNatRule); err != nil { + return VirtualNetworkGatewayNatRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the virtual network gateway. +// - virtualNetworkGatewayName - The name of the gateway. +// - options - VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the +// VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager method. +func (client *VirtualNetworkGatewayNatRulesClient) NewListByVirtualNetworkGatewayPager(resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) *runtime.Pager[VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse]{ + More: func(page VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse) (VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVirtualNetworkGatewayCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, runtime.NewResponseError(resp) + } + return client.listByVirtualNetworkGatewayHandleResponse(resp) + }, + }) +} + +// listByVirtualNetworkGatewayCreateRequest creates the ListByVirtualNetworkGateway request. +func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules" + 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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVirtualNetworkGatewayHandleResponse handles the ListByVirtualNetworkGateway response. +func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayHandleResponse(resp *http.Response) (VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse, error) { + result := VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualNetworkGatewayNatRulesResult); err != nil { + return VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgateways_client.go new file mode 100644 index 00000000000..9705a5842b1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkgateways_client.go @@ -0,0 +1,1536 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworkGatewaysClient contains the methods for the VirtualNetworkGateways group. +// Don't use this type directly, use NewVirtualNetworkGatewaysClient() instead. +type VirtualNetworkGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworkGatewaysClient creates a new instance of VirtualNetworkGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworkGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworkGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworkGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - parameters - Parameters supplied to create or update virtual network gateway operation. +// - options - VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworkGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete +// method. +func (client *VirtualNetworkGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - request - The parameters are supplied to disconnect vpn connections. +// - options - VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters +// for the VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections method. +func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*runtime.Poller[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disconnectVirtualNetworkGatewayVPNConnections(ctx, resourceGroupName, virtualNetworkGatewayName, request, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DisconnectVirtualNetworkGatewayVPNConnections - Disconnect vpn connections of virtual network gateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*http.Response, error) { + req, err := client.disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, request, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest creates the DisconnectVirtualNetworkGatewayVPNConnections request. +func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections" + 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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} + +// BeginGenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource +// group. Used for IKEV2 and radius based authentication. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. +// - options - VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile +// method. +func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGenerateVPNProfileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.generateVPNProfile(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGenerateVPNProfileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGenerateVPNProfileResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GenerateVPNProfile - Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. +// Used for IKEV2 and radius based authentication. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) generateVPNProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*http.Response, error) { + req, err := client.generateVPNProfileCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// generateVPNProfileCreateRequest creates the GenerateVPNProfile request. +func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGeneratevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. +// - options - VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage +// method. +func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.generatevpnclientpackage(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Generatevpnclientpackage - Generates VPN client package for P2S client of the virtual network gateway in the specified +// resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*http.Response, error) { + req, err := client.generatevpnclientpackageCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// generatevpnclientpackageCreateRequest creates the Generatevpnclientpackage request. +func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets the specified virtual network gateway by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get +// method. +func (client *VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientGetOptions) (VirtualNetworkGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return VirtualNetworkGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientGetResponse, error) { + result := VirtualNetworkGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGateway); err != nil { + return VirtualNetworkGatewaysClientGetResponse{}, err + } + return result, nil +} + +// BeginGetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the +// specified peer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - peer - The IP address of the peer. +// - options - VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getAdvertisedRoutes(ctx, resourceGroupName, virtualNetworkGatewayName, peer, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetAdvertisedRoutes - This operation retrieves a list of routes the virtual network gateway is advertising to the specified +// peer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*http.Response, error) { + req, err := client.getAdvertisedRoutesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, peer, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getAdvertisedRoutesCreateRequest creates the GetAdvertisedRoutes request. +func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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("peer", peer) + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getBgpPeerStatus(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetBgpPeerStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetBgpPeerStatus - The GetBgpPeerStatus operation retrieves the status of all BGP peers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { + req, err := client.getBgpPeerStatusCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getBgpPeerStatusCreateRequest creates the GetBgpPeerStatus request. +func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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.Peer != nil { + reqQP.Set("peer", *options.Peer) + } + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes +// learned from BGP peers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetLearnedRoutesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getLearnedRoutes(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetLearnedRoutesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetLearnedRoutesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetLearnedRoutes - This operation retrieves a list of routes the virtual network gateway has learned, including routes +// learned from BGP peers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { + req, err := client.getLearnedRoutesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getLearnedRoutesCreateRequest creates the GetLearnedRoutes request. +func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetVPNProfilePackageURL - Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified +// resource group. The profile needs to be generated first using generateVpnProfile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getVPNProfilePackageURL(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetVPNProfilePackageURL - Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified +// resource group. The profile needs to be generated first using generateVpnProfile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { + req, err := client.getVPNProfilePackageURLCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getVPNProfilePackageURLCreateRequest creates the GetVPNProfilePackageURL request. +func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network +// gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the +// VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth method. +func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getVpnclientConnectionHealth(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetVpnclientConnectionHealth - Get VPN client connection health detail per P2S client connection of the virtual network +// gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { + req, err := client.getVpnclientConnectionHealthCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getVpnclientConnectionHealthCreateRequest creates the GetVpnclientConnectionHealth request. +func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginGetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient +// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource +// provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The virtual network gateway name. +// - options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the +// VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters method. +func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getVpnclientIPSecParameters(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetVpnclientIPSecParameters - The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec +// policy for P2S client of virtual network gateway in the specified resource group through Network resource +// provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { + req, err := client.getVpnclientIPSecParametersCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getVpnclientIPSecParametersCreateRequest creates the GetVpnclientIPSecParameters request. +func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListPager - Gets all virtual network gateways by resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager +// method. +func (client *VirtualNetworkGatewaysClient) NewListPager(resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) *runtime.Pager[VirtualNetworkGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewaysClientListResponse]{ + More: func(page VirtualNetworkGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkGatewaysClientListResponse) (VirtualNetworkGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientListResponse, error) { + result := VirtualNetworkGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayListResult); err != nil { + return VirtualNetworkGatewaysClientListResponse{}, err + } + return result, nil +} + +// NewListConnectionsPager - Gets all the connections in a virtual network gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListConnectionsPager +// method. +func (client *VirtualNetworkGatewaysClient) NewListConnectionsPager(resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientListConnectionsOptions) *runtime.Pager[VirtualNetworkGatewaysClientListConnectionsResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkGatewaysClientListConnectionsResponse]{ + More: func(page VirtualNetworkGatewaysClientListConnectionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkGatewaysClientListConnectionsResponse) (VirtualNetworkGatewaysClientListConnectionsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listConnectionsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkGatewaysClientListConnectionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewaysClientListConnectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewaysClientListConnectionsResponse{}, runtime.NewResponseError(resp) + } + return client.listConnectionsHandleResponse(resp) + }, + }) +} + +// listConnectionsCreateRequest creates the ListConnections request. +func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientListConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listConnectionsHandleResponse handles the ListConnections response. +func (client *VirtualNetworkGatewaysClient) listConnectionsHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientListConnectionsResponse, error) { + result := VirtualNetworkGatewaysClientListConnectionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkGatewayListConnectionsResult); err != nil { + return VirtualNetworkGatewaysClientListConnectionsResponse{}, err + } + return result, nil +} + +// BeginReset - Resets the primary of the virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset +// method. +func (client *VirtualNetworkGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*runtime.Poller[VirtualNetworkGatewaysClientResetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reset(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientResetResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Reset - Resets the primary of the virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { + req, err := client.resetCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetCreateRequest creates the Reset request. +func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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.GatewayVip != nil { + reqQP.Set("gatewayVip", *options.GatewayVip) + } + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource +// group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey +// method. +func (client *VirtualNetworkGatewaysClient) BeginResetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*runtime.Poller[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetVPNClientSharedKey(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ResetVPNClientSharedKey - Resets the VPN client shared key of the virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { + req, err := client.resetVPNClientSharedKeyCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetVPNClientSharedKeyCreateRequest creates the ResetVPNClientSharedKey request. +func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginSetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client +// of virtual network gateway in the specified resource group through Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - vpnclientIPSecParams - Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client +// operation through Network resource provider. +// - options - VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions contains the optional parameters for the +// VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters method. +func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*runtime.Poller[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.setVpnclientIPSecParameters(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIPSecParams, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientSetVpnclientIPSecParametersResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// SetVpnclientIPSecParameters - The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client +// of virtual network gateway in the specified resource group through Network resource provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*http.Response, error) { + req, err := client.setVpnclientIPSecParametersCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIPSecParams, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// setVpnclientIPSecParametersCreateRequest creates the SetVpnclientIPSecParameters request. +func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnclientIPSecParams) +} + +// BeginStartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture +// method. +func (client *VirtualNetworkGatewaysClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewaysClientStartPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStartPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientStartPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StartPacketCapture - Starts packet capture on virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { + req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startPacketCaptureCreateRequest creates the StartPacketCapture request. +func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// BeginStopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. +// - options - VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture +// method. +func (client *VirtualNetworkGatewaysClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*runtime.Poller[VirtualNetworkGatewaysClientStopPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopPacketCapture(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientStopPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientStopPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StopPacketCapture - Stops packet capture on virtual network gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { + req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopPacketCaptureCreateRequest creates the StopPacketCapture request. +func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// SupportedVPNDevices - Gets a xml format representation for supported vpn devices. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices +// method. +func (client *VirtualNetworkGatewaysClient) SupportedVPNDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (VirtualNetworkGatewaysClientSupportedVPNDevicesResponse, error) { + req, err := client.supportedVPNDevicesCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, runtime.NewResponseError(resp) + } + return client.supportedVPNDevicesHandleResponse(resp) +} + +// supportedVPNDevicesCreateRequest creates the SupportedVPNDevices request. +func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// supportedVPNDevicesHandleResponse handles the SupportedVPNDevices response. +func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientSupportedVPNDevicesResponse, error) { + result := VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return VirtualNetworkGatewaysClientSupportedVPNDevicesResponse{}, err + } + return result, nil +} + +// BeginUpdateTags - Updates a virtual network gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - parameters - Parameters supplied to update virtual network gateway tags. +// - options - VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags +// method. +func (client *VirtualNetworkGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[VirtualNetworkGatewaysClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkGatewaysClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates a virtual network gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// VPNDeviceConfigurationScript - Gets a xml format representation for vpn device configuration script. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script +// is generated. +// - parameters - Parameters supplied to the generate vpn device script operation. +// - options - VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions contains the optional parameters for the VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript +// method. +func (client *VirtualNetworkGatewaysClient) VPNDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, options *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse, error) { + req, err := client.vpnDeviceConfigurationScriptCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) + if err != nil { + return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, runtime.NewResponseError(resp) + } + return client.vpnDeviceConfigurationScriptHandleResponse(resp) +} + +// vpnDeviceConfigurationScriptCreateRequest creates the VPNDeviceConfigurationScript request. +func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, options *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayConnectionName == "" { + return nil, errors.New("parameter virtualNetworkGatewayConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayConnectionName}", url.PathEscape(virtualNetworkGatewayConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// vpnDeviceConfigurationScriptHandleResponse handles the VPNDeviceConfigurationScript response. +func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptHandleResponse(resp *http.Response) (VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse, error) { + result := VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkpeerings_client.go new file mode 100644 index 00000000000..d362464b8d1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworkpeerings_client.go @@ -0,0 +1,327 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworkPeeringsClient contains the methods for the VirtualNetworkPeerings group. +// Don't use this type directly, use NewVirtualNetworkPeeringsClient() instead. +type VirtualNetworkPeeringsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworkPeeringsClient creates a new instance of VirtualNetworkPeeringsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworkPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkPeeringsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworkPeeringsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworkPeeringsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a peering in the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - virtualNetworkPeeringName - The name of the peering. +// - virtualNetworkPeeringParameters - Parameters supplied to the create or update virtual network peering operation. +// - options - VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworkPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkPeeringsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkPeeringsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a peering in the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, options *VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if virtualNetworkPeeringName == "" { + return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) + 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.SyncRemoteAddressSpace != nil { + reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) + } + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, virtualNetworkPeeringParameters) +} + +// BeginDelete - Deletes the specified virtual network peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - virtualNetworkPeeringName - The name of the virtual network peering. +// - options - VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete +// method. +func (client *VirtualNetworkPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkPeeringsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkPeeringsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkPeeringsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified virtual network peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if virtualNetworkPeeringName == "" { + return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified virtual network peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - virtualNetworkPeeringName - The name of the virtual network peering. +// - options - VirtualNetworkPeeringsClientGetOptions contains the optional parameters for the VirtualNetworkPeeringsClient.Get +// method. +func (client *VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientGetOptions) (VirtualNetworkPeeringsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) + if err != nil { + return VirtualNetworkPeeringsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkPeeringsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkPeeringsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, options *VirtualNetworkPeeringsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + if virtualNetworkPeeringName == "" { + return nil, errors.New("parameter virtualNetworkPeeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkPeeringName}", url.PathEscape(virtualNetworkPeeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Response) (VirtualNetworkPeeringsClientGetResponse, error) { + result := VirtualNetworkPeeringsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkPeering); err != nil { + return VirtualNetworkPeeringsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all virtual network peerings in a virtual network. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.NewListPager +// method. +func (client *VirtualNetworkPeeringsClient) NewListPager(resourceGroupName string, virtualNetworkName string, options *VirtualNetworkPeeringsClientListOptions) *runtime.Pager[VirtualNetworkPeeringsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkPeeringsClientListResponse]{ + More: func(page VirtualNetworkPeeringsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkPeeringsClientListResponse) (VirtualNetworkPeeringsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkPeeringsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkPeeringsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkPeeringsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworkPeeringsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualNetworkPeeringsClient) listHandleResponse(resp *http.Response) (VirtualNetworkPeeringsClientListResponse, error) { + result := VirtualNetworkPeeringsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkPeeringListResult); err != nil { + return VirtualNetworkPeeringsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworks_client.go new file mode 100644 index 00000000000..2f92b75a6cf --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworks_client.go @@ -0,0 +1,658 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworksClient contains the methods for the VirtualNetworks group. +// Don't use this type directly, use NewVirtualNetworksClient() instead. +type VirtualNetworksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworksClient creates a new instance of VirtualNetworksClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworksClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckIPAddressAvailability - Checks whether a private IP address is available for use. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - ipAddress - The private IP address to be verified. +// - options - VirtualNetworksClientCheckIPAddressAvailabilityOptions contains the optional parameters for the VirtualNetworksClient.CheckIPAddressAvailability +// method. +func (client *VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, ipAddress string, options *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (VirtualNetworksClientCheckIPAddressAvailabilityResponse, error) { + req, err := client.checkIPAddressAvailabilityCreateRequest(ctx, resourceGroupName, virtualNetworkName, ipAddress, options) + if err != nil { + return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, runtime.NewResponseError(resp) + } + return client.checkIPAddressAvailabilityHandleResponse(resp) +} + +// checkIPAddressAvailabilityCreateRequest creates the CheckIPAddressAvailability request. +func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, ipAddress string, options *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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("ipAddress", ipAddress) + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// checkIPAddressAvailabilityHandleResponse handles the CheckIPAddressAvailability response. +func (client *VirtualNetworksClient) checkIPAddressAvailabilityHandleResponse(resp *http.Response) (VirtualNetworksClientCheckIPAddressAvailabilityResponse, error) { + result := VirtualNetworksClientCheckIPAddressAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IPAddressAvailabilityResult); err != nil { + return VirtualNetworksClientCheckIPAddressAvailabilityResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Creates or updates a virtual network in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - parameters - Parameters supplied to the create or update virtual network operation. +// - options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworksClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworkName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworksClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a virtual network in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete +// method. +func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworksClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualNetworkName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworksClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified virtual network. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified virtual network by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. +func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (VirtualNetworksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + if err != nil { + return VirtualNetworksClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (VirtualNetworksClientGetResponse, error) { + result := VirtualNetworksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetwork); err != nil { + return VirtualNetworksClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all virtual networks in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager +// method. +func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, options *VirtualNetworksClientListOptions) *runtime.Pager[VirtualNetworksClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListResponse]{ + More: func(page VirtualNetworksClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworksClientListResponse) (VirtualNetworksClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworksClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (VirtualNetworksClientListResponse, error) { + result := VirtualNetworksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListResult); err != nil { + return VirtualNetworksClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all virtual networks in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager +// method. +func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListAllResponse]{ + More: func(page VirtualNetworksClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworksClientListAllResponse) (VirtualNetworksClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworksClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworksClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *VirtualNetworksClient) listAllHandleResponse(resp *http.Response) (VirtualNetworksClientListAllResponse, error) { + result := VirtualNetworksClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListResult); err != nil { + return VirtualNetworksClientListAllResponse{}, err + } + return result, nil +} + +// BeginListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus +// method. +func (client *VirtualNetworksClient) BeginListDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*runtime.Poller[*runtime.Pager[VirtualNetworksClientListDdosProtectionStatusResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListDdosProtectionStatusResponse]{ + More: func(page VirtualNetworksClientListDdosProtectionStatusResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworksClientListDdosProtectionStatusResponse) (VirtualNetworksClientListDdosProtectionStatusResponse, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + if err != nil { + return VirtualNetworksClientListDdosProtectionStatusResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientListDdosProtectionStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientListDdosProtectionStatusResponse{}, runtime.NewResponseError(resp) + } + return client.listDdosProtectionStatusHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.listDdosProtectionStatus(ctx, resourceGroupName, virtualNetworkName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[*runtime.Pager[VirtualNetworksClientListDdosProtectionStatusResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[VirtualNetworksClientListDdosProtectionStatusResponse]]{ + Response: &pager, + }) + } +} + +// ListDdosProtectionStatus - Gets the Ddos Protection Status of all IP Addresses under the Virtual Network +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*http.Response, error) { + req, err := client.listDdosProtectionStatusCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listDdosProtectionStatusCreateRequest creates the ListDdosProtectionStatus request. +func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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.Top != nil { + reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("skipToken", *options.SkipToken) + } + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listDdosProtectionStatusHandleResponse handles the ListDdosProtectionStatus response. +func (client *VirtualNetworksClient) listDdosProtectionStatusHandleResponse(resp *http.Response) (VirtualNetworksClientListDdosProtectionStatusResponse, error) { + result := VirtualNetworksClientListDdosProtectionStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkDdosProtectionStatusResult); err != nil { + return VirtualNetworksClientListDdosProtectionStatusResponse{}, err + } + return result, nil +} + +// NewListUsagePager - Lists usage stats. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - options - VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.NewListUsagePager +// method. +func (client *VirtualNetworksClient) NewListUsagePager(resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientListUsageOptions) *runtime.Pager[VirtualNetworksClientListUsageResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListUsageResponse]{ + More: func(page VirtualNetworksClientListUsageResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworksClientListUsageResponse) (VirtualNetworksClientListUsageResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listUsageCreateRequest(ctx, resourceGroupName, virtualNetworkName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworksClientListUsageResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientListUsageResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientListUsageResponse{}, runtime.NewResponseError(resp) + } + return client.listUsageHandleResponse(resp) + }, + }) +} + +// listUsageCreateRequest creates the ListUsage request. +func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientListUsageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listUsageHandleResponse handles the ListUsage response. +func (client *VirtualNetworksClient) listUsageHandleResponse(resp *http.Response) (VirtualNetworksClientListUsageResponse, error) { + result := VirtualNetworksClientListUsageResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkListUsageResult); err != nil { + return VirtualNetworksClientListUsageResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a virtual network tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkName - The name of the virtual network. +// - parameters - Parameters supplied to update virtual network tags. +// - options - VirtualNetworksClientUpdateTagsOptions contains the optional parameters for the VirtualNetworksClient.UpdateTags +// method. +func (client *VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject, options *VirtualNetworksClientUpdateTagsOptions) (VirtualNetworksClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualNetworkName, parameters, options) + if err != nil { + return VirtualNetworksClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworksClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworksClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject, options *VirtualNetworksClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkName == "" { + return nil, errors.New("parameter virtualNetworkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkName}", url.PathEscape(virtualNetworkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VirtualNetworksClient) updateTagsHandleResponse(resp *http.Response) (VirtualNetworksClientUpdateTagsResponse, error) { + result := VirtualNetworksClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetwork); err != nil { + return VirtualNetworksClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworktaps_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworktaps_client.go new file mode 100644 index 00000000000..8015f36ddb8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualnetworktaps_client.go @@ -0,0 +1,422 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualNetworkTapsClient contains the methods for the VirtualNetworkTaps group. +// Don't use this type directly, use NewVirtualNetworkTapsClient() instead. +type VirtualNetworkTapsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualNetworkTapsClient creates a new instance of VirtualNetworkTapsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkTapsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualNetworkTapsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualNetworkTapsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a Virtual Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - tapName - The name of the virtual network tap. +// - parameters - Parameters supplied to the create or update virtual network tap operation. +// - options - VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate +// method. +func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkTapsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, tapName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkTapsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkTapsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a Virtual Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkTapsClient) createOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, tapName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if tapName == "" { + return nil, errors.New("parameter tapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified virtual network tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - tapName - The name of the virtual network tap. +// - options - VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete +// method. +func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkTapsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, tapName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkTapsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualNetworkTapsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified virtual network tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, tapName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if tapName == "" { + return nil, errors.New("parameter tapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets information about the specified virtual network tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - tapName - The name of virtual network tap. +// - options - VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. +func (client *VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (VirtualNetworkTapsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, tapName, options) + if err != nil { + return VirtualNetworkTapsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkTapsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkTapsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if tapName == "" { + return nil, errors.New("parameter tapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) (VirtualNetworkTapsClientGetResponse, error) { + result := VirtualNetworkTapsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTap); err != nil { + return VirtualNetworkTapsClientGetResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager +// method. +func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkTapsClientListAllResponse]{ + More: func(page VirtualNetworkTapsClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkTapsClientListAllResponse) (VirtualNetworkTapsClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkTapsClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkTapsClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkTapsClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworkTapsClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Response) (VirtualNetworkTapsClientListAllResponse, error) { + result := VirtualNetworkTapsClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTapListResult); err != nil { + return VirtualNetworkTapsClientListAllResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager +// method. +func (client *VirtualNetworkTapsClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) *runtime.Pager[VirtualNetworkTapsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkTapsClientListByResourceGroupResponse]{ + More: func(page VirtualNetworkTapsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualNetworkTapsClientListByResourceGroupResponse) (VirtualNetworkTapsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualNetworkTapsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkTapsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkTapsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualNetworkTapsClientListByResourceGroupResponse, error) { + result := VirtualNetworkTapsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTapListResult); err != nil { + return VirtualNetworkTapsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates an VirtualNetworkTap tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - tapName - The name of the tap. +// - tapParameters - Parameters supplied to update VirtualNetworkTap tags. +// - options - VirtualNetworkTapsClientUpdateTagsOptions contains the optional parameters for the VirtualNetworkTapsClient.UpdateTags +// method. +func (client *VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject, options *VirtualNetworkTapsClientUpdateTagsOptions) (VirtualNetworkTapsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, tapName, tapParameters, options) + if err != nil { + return VirtualNetworkTapsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualNetworkTapsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualNetworkTapsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject, options *VirtualNetworkTapsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if tapName == "" { + return nil, errors.New("parameter tapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tapName}", url.PathEscape(tapName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, tapParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VirtualNetworkTapsClient) updateTagsHandleResponse(resp *http.Response) (VirtualNetworkTapsClientUpdateTagsResponse, error) { + result := VirtualNetworkTapsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkTap); err != nil { + return VirtualNetworkTapsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouterpeerings_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouterpeerings_client.go new file mode 100644 index 00000000000..4447508f86c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouterpeerings_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualRouterPeeringsClient contains the methods for the VirtualRouterPeerings group. +// Don't use this type directly, use NewVirtualRouterPeeringsClient() instead. +type VirtualRouterPeeringsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualRouterPeeringsClient creates a new instance of VirtualRouterPeeringsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualRouterPeeringsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRouterPeeringsClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualRouterPeeringsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualRouterPeeringsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Virtual Router Peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - peeringName - The name of the Virtual Router Peering. +// - parameters - Parameters supplied to the create or update Virtual Router Peering operation. +// - options - VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate +// method. +func (client *VirtualRouterPeeringsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualRouterPeeringsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualRouterName, peeringName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRouterPeeringsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualRouterPeeringsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Virtual Router Peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualRouterPeeringsClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified peering from a Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - peeringName - The name of the peering. +// - options - VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete +// method. +func (client *VirtualRouterPeeringsClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*runtime.Poller[VirtualRouterPeeringsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualRouterName, peeringName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRouterPeeringsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualRouterPeeringsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified peering from a Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualRouterPeeringsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Virtual Router Peering. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - peeringName - The name of the Virtual Router Peering. +// - options - VirtualRouterPeeringsClientGetOptions contains the optional parameters for the VirtualRouterPeeringsClient.Get +// method. +func (client *VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientGetOptions) (VirtualRouterPeeringsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualRouterName, peeringName, options) + if err != nil { + return VirtualRouterPeeringsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualRouterPeeringsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualRouterPeeringsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, options *VirtualRouterPeeringsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + if peeringName == "" { + return nil, errors.New("parameter peeringName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{peeringName}", url.PathEscape(peeringName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response) (VirtualRouterPeeringsClientGetResponse, error) { + result := VirtualRouterPeeringsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterPeering); err != nil { + return VirtualRouterPeeringsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - options - VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.NewListPager +// method. +func (client *VirtualRouterPeeringsClient) NewListPager(resourceGroupName string, virtualRouterName string, options *VirtualRouterPeeringsClientListOptions) *runtime.Pager[VirtualRouterPeeringsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualRouterPeeringsClientListResponse]{ + More: func(page VirtualRouterPeeringsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualRouterPeeringsClientListResponse) (VirtualRouterPeeringsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, virtualRouterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualRouterPeeringsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualRouterPeeringsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualRouterPeeringsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRouterPeeringsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualRouterPeeringsClient) listHandleResponse(resp *http.Response) (VirtualRouterPeeringsClientListResponse, error) { + result := VirtualRouterPeeringsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterPeeringListResult); err != nil { + return VirtualRouterPeeringsClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouters_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouters_client.go new file mode 100644 index 00000000000..64c57c22585 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualrouters_client.go @@ -0,0 +1,365 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualRoutersClient contains the methods for the VirtualRouters group. +// Don't use this type directly, use NewVirtualRoutersClient() instead. +type VirtualRoutersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualRoutersClient creates a new instance of VirtualRoutersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualRoutersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualRoutersClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualRoutersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualRoutersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the specified Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - parameters - Parameters supplied to the create or update Virtual Router. +// - options - VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate +// method. +func (client *VirtualRoutersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualRoutersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualRouterName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRoutersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualRoutersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates the specified Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualRoutersClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualRouterName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the specified Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - options - VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete +// method. +func (client *VirtualRoutersClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*runtime.Poller[VirtualRoutersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualRouterName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualRoutersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualRoutersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualRouterName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified Virtual Router. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - virtualRouterName - The name of the Virtual Router. +// - options - VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. +func (client *VirtualRoutersClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (VirtualRoutersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualRouterName, options) + if err != nil { + return VirtualRoutersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualRoutersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualRoutersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualRouterName == "" { + return nil, errors.New("parameter virtualRouterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualRouterName}", url.PathEscape(virtualRouterName)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (VirtualRoutersClientGetResponse, error) { + result := VirtualRoutersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouter); err != nil { + return VirtualRoutersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all the Virtual Routers in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualRoutersClientListOptions contains the optional parameters for the VirtualRoutersClient.NewListPager method. +func (client *VirtualRoutersClient) NewListPager(options *VirtualRoutersClientListOptions) *runtime.Pager[VirtualRoutersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListResponse]{ + More: func(page VirtualRoutersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualRoutersClientListResponse) (VirtualRoutersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualRoutersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualRoutersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualRoutersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, options *VirtualRoutersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (VirtualRoutersClientListResponse, error) { + result := VirtualRoutersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil { + return VirtualRoutersClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager +// method. +func (client *VirtualRoutersClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) *runtime.Pager[VirtualRoutersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualRoutersClientListByResourceGroupResponse]{ + More: func(page VirtualRoutersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualRoutersClientListByResourceGroupResponse) (VirtualRoutersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualRoutersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualRoutersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualRoutersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VirtualRoutersClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualRoutersClientListByResourceGroupResponse, error) { + result := VirtualRoutersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualRouterListResult); err != nil { + return VirtualRoutersClientListByResourceGroupResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualwans_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualwans_client.go new file mode 100644 index 00000000000..2d77bcfde68 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/virtualwans_client.go @@ -0,0 +1,419 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VirtualWansClient contains the methods for the VirtualWans group. +// Don't use this type directly, use NewVirtualWansClient() instead. +type VirtualWansClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVirtualWansClient creates a new instance of VirtualWansClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVirtualWansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualWansClient, error) { + cl, err := arm.NewClient(moduleName+".VirtualWansClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VirtualWansClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualWan. +// - virtualWANName - The name of the VirtualWAN being created or updated. +// - wanParameters - Parameters supplied to create or update VirtualWAN. +// - options - VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate +// method. +func (client *VirtualWansClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualWansClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualWANName, wanParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualWansClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualWansClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualWansClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualWANName, wanParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, wanParameters) +} + +// BeginDelete - Deletes a VirtualWAN. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualWan. +// - virtualWANName - The name of the VirtualWAN being deleted. +// - options - VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. +func (client *VirtualWansClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*runtime.Poller[VirtualWansClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualWansClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VirtualWansClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VirtualWAN. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a VirtualWAN. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualWan. +// - virtualWANName - The name of the VirtualWAN being retrieved. +// - options - VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. +func (client *VirtualWansClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientGetOptions) (VirtualWansClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return VirtualWansClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualWansClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualWansClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (VirtualWansClientGetResponse, error) { + result := VirtualWansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWAN); err != nil { + return VirtualWansClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the VirtualWANs in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VirtualWansClientListOptions contains the optional parameters for the VirtualWansClient.NewListPager method. +func (client *VirtualWansClient) NewListPager(options *VirtualWansClientListOptions) *runtime.Pager[VirtualWansClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListResponse]{ + More: func(page VirtualWansClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualWansClientListResponse) (VirtualWansClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualWansClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualWansClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualWansClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options *VirtualWansClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (VirtualWansClientListResponse, error) { + result := VirtualWansClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualWANsResult); err != nil { + return VirtualWansClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualWan. +// - options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager +// method. +func (client *VirtualWansClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) *runtime.Pager[VirtualWansClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualWansClientListByResourceGroupResponse]{ + More: func(page VirtualWansClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VirtualWansClientListByResourceGroupResponse) (VirtualWansClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VirtualWansClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualWansClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualWansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VirtualWansClient) listByResourceGroupHandleResponse(resp *http.Response) (VirtualWansClientListByResourceGroupResponse, error) { + result := VirtualWansClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVirtualWANsResult); err != nil { + return VirtualWansClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates a VirtualWAN tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VirtualWan. +// - virtualWANName - The name of the VirtualWAN being updated. +// - wanParameters - Parameters supplied to Update VirtualWAN tags. +// - options - VirtualWansClientUpdateTagsOptions contains the optional parameters for the VirtualWansClient.UpdateTags method. +func (client *VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (VirtualWansClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, virtualWANName, wanParameters, options) + if err != nil { + return VirtualWansClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VirtualWansClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VirtualWansClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{VirtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, wanParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VirtualWansClient) updateTagsHandleResponse(resp *http.Response) (VirtualWansClientUpdateTagsResponse, error) { + result := VirtualWansClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualWAN); err != nil { + return VirtualWansClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnconnections_client.go new file mode 100644 index 00000000000..5a3205bfd3d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnconnections_client.go @@ -0,0 +1,474 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNConnectionsClient contains the methods for the VPNConnections group. +// Don't use this type directly, use NewVPNConnectionsClient() instead. +type VPNConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNConnectionsClient creates a new instance of VPNConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".VPNConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing +// connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the connection. +// - vpnConnectionParameters - Parameters supplied to create or Update a VPN Connection. +// - options - VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate +// method. +func (client *VPNConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnConnectionParameters) +} + +// BeginDelete - Deletes a vpn connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the connection. +// - options - VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete +// method. +func (client *VPNConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*runtime.Poller[VPNConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, connectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a vpn connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a vpn connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the vpn connection. +// - options - VPNConnectionsClientGetOptions contains the optional parameters for the VPNConnectionsClient.Get method. +func (client *VPNConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (VPNConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) + if err != nil { + return VPNConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNConnectionsClient) getHandleResponse(resp *http.Response) (VPNConnectionsClientGetResponse, error) { + result := VPNConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNConnection); err != nil { + return VPNConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByVPNGatewayPager - Retrieves all vpn connections for a particular virtual wan vpn gateway. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.NewListByVPNGatewayPager +// method. +func (client *VPNConnectionsClient) NewListByVPNGatewayPager(resourceGroupName string, gatewayName string, options *VPNConnectionsClientListByVPNGatewayOptions) *runtime.Pager[VPNConnectionsClientListByVPNGatewayResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNConnectionsClientListByVPNGatewayResponse]{ + More: func(page VPNConnectionsClientListByVPNGatewayResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNConnectionsClientListByVPNGatewayResponse) (VPNConnectionsClientListByVPNGatewayResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVPNGatewayCreateRequest(ctx, resourceGroupName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNConnectionsClientListByVPNGatewayResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNConnectionsClientListByVPNGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNConnectionsClientListByVPNGatewayResponse{}, runtime.NewResponseError(resp) + } + return client.listByVPNGatewayHandleResponse(resp) + }, + }) +} + +// listByVPNGatewayCreateRequest creates the ListByVPNGateway request. +func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNConnectionsClientListByVPNGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVPNGatewayHandleResponse handles the ListByVPNGateway response. +func (client *VPNConnectionsClient) listByVPNGatewayHandleResponse(resp *http.Response) (VPNConnectionsClientListByVPNGatewayResponse, error) { + result := VPNConnectionsClientListByVPNGatewayResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNConnectionsResult); err != nil { + return VPNConnectionsClientListByVPNGatewayResponse{}, err + } + return result, nil +} + +// BeginStartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the gateway. +// - vpnConnectionName - The name of the vpn connection. +// - options - VPNConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStartPacketCapture +// method. +func (client *VPNConnectionsClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*runtime.Poller[VPNConnectionsClientStartPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startPacketCapture(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientStartPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNConnectionsClientStartPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StartPacketCapture - Starts packet capture on Vpn connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { + req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startPacketCaptureCreateRequest creates the StartPacketCapture request. +func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStartPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if vpnConnectionName == "" { + return nil, errors.New("parameter vpnConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// BeginStopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the gateway. +// - vpnConnectionName - The name of the vpn connection. +// - options - VPNConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNConnectionsClient.BeginStopPacketCapture +// method. +func (client *VPNConnectionsClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*runtime.Poller[VPNConnectionsClientStopPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopPacketCapture(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNConnectionsClientStopPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNConnectionsClientStopPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StopPacketCapture - Stops packet capture on Vpn connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNConnectionsClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*http.Response, error) { + req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, vpnConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopPacketCaptureCreateRequest creates the StopPacketCapture request. +func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, options *VPNConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if vpnConnectionName == "" { + return nil, errors.New("parameter vpnConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnConnectionName}", url.PathEscape(vpnConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpngateways_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpngateways_client.go new file mode 100644 index 00000000000..9eb359ab150 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpngateways_client.go @@ -0,0 +1,638 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNGatewaysClient contains the methods for the VPNGateways group. +// Don't use this type directly, use NewVPNGatewaysClient() instead. +type VPNGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNGatewaysClient creates a new instance of VPNGatewaysClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".VPNGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - vpnGatewayParameters - Parameters supplied to create or Update a virtual wan vpn gateway. +// - options - VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate +// method. +func (client *VPNGatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNGatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnGatewayParameters) +} + +// BeginDelete - Deletes a virtual wan vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. +func (client *VPNGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*runtime.Poller[VPNGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a virtual wan vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a virtual wan vpn gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. +func (client *VPNGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (VPNGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return VPNGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGatewaysClientGetResponse, error) { + result := VPNGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNGateway); err != nil { + return VPNGatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the VpnGateways in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VPNGatewaysClientListOptions contains the optional parameters for the VPNGatewaysClient.NewListPager method. +func (client *VPNGatewaysClient) NewListPager(options *VPNGatewaysClientListOptions) *runtime.Pager[VPNGatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListResponse]{ + More: func(page VPNGatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNGatewaysClientListResponse) (VPNGatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNGatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNGatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNGatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options *VPNGatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGatewaysClientListResponse, error) { + result := VPNGatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewaysResult); err != nil { + return VPNGatewaysClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager +// method. +func (client *VPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) *runtime.Pager[VPNGatewaysClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNGatewaysClientListByResourceGroupResponse]{ + More: func(page VPNGatewaysClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNGatewaysClientListByResourceGroupResponse) (VPNGatewaysClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNGatewaysClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNGatewaysClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VPNGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNGatewaysClientListByResourceGroupResponse, error) { + result := VPNGatewaysClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNGatewaysResult); err != nil { + return VPNGatewaysClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// BeginReset - Resets the primary of the vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. +func (client *VPNGatewaysClient) BeginReset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*runtime.Poller[VPNGatewaysClientResetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reset(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientResetResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientResetResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Reset - Resets the primary of the vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { + req, err := client.resetCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetCreateRequest creates the Reset request. +func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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.IPConfigurationID != nil { + reqQP.Set("ipConfigurationId", *options.IPConfigurationID) + } + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture +// method. +func (client *VPNGatewaysClient) BeginStartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*runtime.Poller[VPNGatewaysClientStartPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startPacketCapture(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientStartPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientStartPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StartPacketCapture - Starts packet capture on vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { + req, err := client.startPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startPacketCaptureCreateRequest creates the StartPacketCapture request. +func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// BeginStopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - options - VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture +// method. +func (client *VPNGatewaysClient) BeginStopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*runtime.Poller[VPNGatewaysClientStopPacketCaptureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopPacketCapture(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientStopPacketCaptureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientStopPacketCaptureResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// StopPacketCapture - Stops packet capture on vpn gateway in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { + req, err := client.stopPacketCaptureCreateRequest(ctx, resourceGroupName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopPacketCaptureCreateRequest creates the StopPacketCapture request. +func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil +} + +// BeginUpdateTags - Updates virtual wan vpn gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - vpnGatewayParameters - Parameters supplied to update a virtual wan vpn gateway tags. +// - options - VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags +// method. +func (client *VPNGatewaysClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*runtime.Poller[VPNGatewaysClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNGatewaysClientUpdateTagsResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNGatewaysClientUpdateTagsResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateTags - Updates virtual wan vpn gateway tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNGatewaysClient) updateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*http.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, gatewayName, vpnGatewayParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnGatewayParameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnlinkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnlinkconnections_client.go new file mode 100644 index 00000000000..5ed63a00991 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnlinkconnections_client.go @@ -0,0 +1,275 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNLinkConnectionsClient contains the methods for the VPNLinkConnections group. +// Don't use this type directly, use NewVPNLinkConnectionsClient() instead. +type VPNLinkConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNLinkConnectionsClient creates a new instance of VPNLinkConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNLinkConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".VPNLinkConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNLinkConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginGetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the vpn connection. +// - linkConnectionName - The name of the vpn link connection. +// - options - VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas +// method. +func (client *VPNLinkConnectionsClient) BeginGetIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*runtime.Poller[VPNLinkConnectionsClientGetIkeSasResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getIkeSas(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNLinkConnectionsClientGetIkeSasResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNLinkConnectionsClientGetIkeSasResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetIkeSas - Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNLinkConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { + req, err := client.getIkeSasCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getIkeSasCreateRequest creates the GetIkeSas request. +func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + if linkConnectionName == "" { + return nil, errors.New("parameter linkConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// NewListByVPNConnectionPager - Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the vpn gateway. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the vpn connection. +// - options - VPNLinkConnectionsClientListByVPNConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.NewListByVPNConnectionPager +// method. +func (client *VPNLinkConnectionsClient) NewListByVPNConnectionPager(resourceGroupName string, gatewayName string, connectionName string, options *VPNLinkConnectionsClientListByVPNConnectionOptions) *runtime.Pager[VPNLinkConnectionsClientListByVPNConnectionResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNLinkConnectionsClientListByVPNConnectionResponse]{ + More: func(page VPNLinkConnectionsClientListByVPNConnectionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNLinkConnectionsClientListByVPNConnectionResponse) (VPNLinkConnectionsClientListByVPNConnectionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVPNConnectionCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNLinkConnectionsClientListByVPNConnectionResponse{}, runtime.NewResponseError(resp) + } + return client.listByVPNConnectionHandleResponse(resp) + }, + }) +} + +// listByVPNConnectionCreateRequest creates the ListByVPNConnection request. +func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNLinkConnectionsClientListByVPNConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVPNConnectionHandleResponse handles the ListByVPNConnection response. +func (client *VPNLinkConnectionsClient) listByVPNConnectionHandleResponse(resp *http.Response) (VPNLinkConnectionsClientListByVPNConnectionResponse, error) { + result := VPNLinkConnectionsClientListByVPNConnectionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSiteLinkConnectionsResult); err != nil { + return VPNLinkConnectionsClientListByVPNConnectionResponse{}, err + } + return result, nil +} + +// BeginResetConnection - Resets the VpnLink connection specified. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the vpn connection. +// - linkConnectionName - The name of the vpn link connection. +// - options - VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection +// method. +func (client *VPNLinkConnectionsClient) BeginResetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*runtime.Poller[VPNLinkConnectionsClientResetConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resetConnection(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNLinkConnectionsClientResetConnectionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNLinkConnectionsClientResetConnectionResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ResetConnection - Resets the VpnLink connection specified. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNLinkConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { + req, err := client.resetConnectionCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resetConnectionCreateRequest creates the ResetConnection request. +func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + if linkConnectionName == "" { + return nil, errors.New("parameter linkConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) + 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", "2022-09-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/network/armnetwork/v2/vpnserverconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnserverconfigurations_client.go new file mode 100644 index 00000000000..63aa364cb0a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnserverconfigurations_client.go @@ -0,0 +1,423 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNServerConfigurationsClient contains the methods for the VPNServerConfigurations group. +// Don't use this type directly, use NewVPNServerConfigurationsClient() instead. +type VPNServerConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNServerConfigurationsClient creates a new instance of VPNServerConfigurationsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNServerConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".VPNServerConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNServerConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration being created or updated. +// - vpnServerConfigurationParameters - Parameters supplied to create or update VpnServerConfiguration. +// - options - VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate +// method. +func (client *VPNServerConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNServerConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNServerConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNServerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnServerConfigurationParameters) +} + +// BeginDelete - Deletes a VpnServerConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration being deleted. +// - options - VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete +// method. +func (client *VPNServerConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*runtime.Poller[VPNServerConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, vpnServerConfigurationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNServerConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VpnServerConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a VpnServerConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration being retrieved. +// - options - VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get +// method. +func (client *VPNServerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (VPNServerConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, options) + if err != nil { + return VPNServerConfigurationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNServerConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNServerConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Response) (VPNServerConfigurationsClientGetResponse, error) { + result := VPNServerConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfiguration); err != nil { + return VPNServerConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the VpnServerConfigurations in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager +// method. +func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNServerConfigurationsClientListResponse]{ + More: func(page VPNServerConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNServerConfigurationsClientListResponse) (VPNServerConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNServerConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNServerConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNServerConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Context, options *VPNServerConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Response) (VPNServerConfigurationsClientListResponse, error) { + result := VPNServerConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationsResult); err != nil { + return VPNServerConfigurationsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager +// method. +func (client *VPNServerConfigurationsClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) *runtime.Pager[VPNServerConfigurationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNServerConfigurationsClientListByResourceGroupResponse]{ + More: func(page VPNServerConfigurationsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNServerConfigurationsClientListByResourceGroupResponse) (VPNServerConfigurationsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNServerConfigurationsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNServerConfigurationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNServerConfigurationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNServerConfigurationsClientListByResourceGroupResponse, error) { + result := VPNServerConfigurationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNServerConfigurationsResult); err != nil { + return VPNServerConfigurationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates VpnServerConfiguration tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnServerConfiguration. +// - vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. +// - vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. +// - options - VPNServerConfigurationsClientUpdateTagsOptions contains the optional parameters for the VPNServerConfigurationsClient.UpdateTags +// method. +func (client *VPNServerConfigurationsClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, options *VPNServerConfigurationsClientUpdateTagsOptions) (VPNServerConfigurationsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, options) + if err != nil { + return VPNServerConfigurationsClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNServerConfigurationsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNServerConfigurationsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, options *VPNServerConfigurationsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" + 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 vpnServerConfigurationName == "" { + return nil, errors.New("parameter vpnServerConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnServerConfigurationName}", url.PathEscape(vpnServerConfigurationName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnServerConfigurationParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VPNServerConfigurationsClient) updateTagsHandleResponse(resp *http.Response) (VPNServerConfigurationsClientUpdateTagsResponse, error) { + result := VPNServerConfigurationsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNServerConfiguration); err != nil { + return VPNServerConfigurationsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnserverconfigurationsassociatedwithvirtualwan_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnserverconfigurationsassociatedwithvirtualwan_client.go new file mode 100644 index 00000000000..b12c238ef2f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnserverconfigurationsassociatedwithvirtualwan_client.go @@ -0,0 +1,113 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNServerConfigurationsAssociatedWithVirtualWanClient contains the methods for the VPNServerConfigurationsAssociatedWithVirtualWan group. +// Don't use this type directly, use NewVPNServerConfigurationsAssociatedWithVirtualWanClient() instead. +type VPNServerConfigurationsAssociatedWithVirtualWanClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNServerConfigurationsAssociatedWithVirtualWanClient creates a new instance of VPNServerConfigurationsAssociatedWithVirtualWanClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNServerConfigurationsAssociatedWithVirtualWanClient, error) { + cl, err := arm.NewClient(moduleName+".VPNServerConfigurationsAssociatedWithVirtualWanClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNServerConfigurationsAssociatedWithVirtualWanClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginList - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name. +// - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. +// - options - VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the +// VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList method. +func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) BeginList(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*runtime.Poller[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listOperation(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNServerConfigurationsAssociatedWithVirtualWanClientListResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// List - Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, virtualWANName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listCreateRequest creates the List request. +func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-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/network/armnetwork/v2/vpnsitelinkconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitelinkconnections_client.go new file mode 100644 index 00000000000..118c43ce910 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitelinkconnections_client.go @@ -0,0 +1,114 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNSiteLinkConnectionsClient contains the methods for the VPNSiteLinkConnections group. +// Don't use this type directly, use NewVPNSiteLinkConnectionsClient() instead. +type VPNSiteLinkConnectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNSiteLinkConnectionsClient creates a new instance of VPNSiteLinkConnectionsClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNSiteLinkConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinkConnectionsClient, error) { + cl, err := arm.NewClient(moduleName+".VPNSiteLinkConnectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNSiteLinkConnectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieves the details of a vpn site link connection. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnGateway. +// - gatewayName - The name of the gateway. +// - connectionName - The name of the vpn connection. +// - linkConnectionName - The name of the vpn connection. +// - options - VPNSiteLinkConnectionsClientGetOptions contains the optional parameters for the VPNSiteLinkConnectionsClient.Get +// method. +func (client *VPNSiteLinkConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (VPNSiteLinkConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName, options) + if err != nil { + return VPNSiteLinkConnectionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSiteLinkConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSiteLinkConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}" + 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 gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + if linkConnectionName == "" { + return nil, errors.New("parameter linkConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkConnectionName}", url.PathEscape(linkConnectionName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNSiteLinkConnectionsClient) getHandleResponse(resp *http.Response) (VPNSiteLinkConnectionsClientGetResponse, error) { + result := VPNSiteLinkConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNSiteLinkConnection); err != nil { + return VPNSiteLinkConnectionsClientGetResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitelinks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitelinks_client.go new file mode 100644 index 00000000000..ba64fb6bd4f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitelinks_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNSiteLinksClient contains the methods for the VPNSiteLinks group. +// Don't use this type directly, use NewVPNSiteLinksClient() instead. +type VPNSiteLinksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNSiteLinksClient creates a new instance of VPNSiteLinksClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNSiteLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSiteLinksClient, error) { + cl, err := arm.NewClient(moduleName+".VPNSiteLinksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNSiteLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Retrieves the details of a VPN site link. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite. +// - vpnSiteLinkName - The name of the VpnSiteLink being retrieved. +// - options - VPNSiteLinksClientGetOptions contains the optional parameters for the VPNSiteLinksClient.Get method. +func (client *VPNSiteLinksClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (VPNSiteLinksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteLinkName, options) + if err != nil { + return VPNSiteLinksClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSiteLinksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSiteLinksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + if vpnSiteLinkName == "" { + return nil, errors.New("parameter vpnSiteLinkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteLinkName}", url.PathEscape(vpnSiteLinkName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNSiteLinksClient) getHandleResponse(resp *http.Response) (VPNSiteLinksClientGetResponse, error) { + result := VPNSiteLinksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNSiteLink); err != nil { + return VPNSiteLinksClientGetResponse{}, err + } + return result, nil +} + +// NewListByVPNSitePager - Lists all the vpnSiteLinks in a resource group for a vpn site. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite. +// - options - VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.NewListByVPNSitePager +// method. +func (client *VPNSiteLinksClient) NewListByVPNSitePager(resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) *runtime.Pager[VPNSiteLinksClientListByVPNSiteResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNSiteLinksClientListByVPNSiteResponse]{ + More: func(page VPNSiteLinksClientListByVPNSiteResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNSiteLinksClientListByVPNSiteResponse) (VPNSiteLinksClientListByVPNSiteResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByVPNSiteCreateRequest(ctx, resourceGroupName, vpnSiteName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNSiteLinksClientListByVPNSiteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSiteLinksClientListByVPNSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSiteLinksClientListByVPNSiteResponse{}, runtime.NewResponseError(resp) + } + return client.listByVPNSiteHandleResponse(resp) + }, + }) +} + +// listByVPNSiteCreateRequest creates the ListByVPNSite request. +func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByVPNSiteHandleResponse handles the ListByVPNSite response. +func (client *VPNSiteLinksClient) listByVPNSiteHandleResponse(resp *http.Response) (VPNSiteLinksClientListByVPNSiteResponse, error) { + result := VPNSiteLinksClientListByVPNSiteResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSiteLinksResult); err != nil { + return VPNSiteLinksClientListByVPNSiteResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsites_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsites_client.go new file mode 100644 index 00000000000..86befd69664 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsites_client.go @@ -0,0 +1,419 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNSitesClient contains the methods for the VPNSites group. +// Don't use this type directly, use NewVPNSitesClient() instead. +type VPNSitesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNSitesClient creates a new instance of VPNSitesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesClient, error) { + cl, err := arm.NewClient(moduleName+".VPNSitesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNSitesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite being created or updated. +// - vpnSiteParameters - Parameters supplied to create or update VpnSite. +// - options - VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate +// method. +func (client *VPNSitesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VPNSitesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNSitesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnSiteParameters) +} + +// BeginDelete - Deletes a VpnSite. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite being deleted. +// - options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. +func (client *VPNSitesClient) BeginDelete(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*runtime.Poller[VPNSitesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, vpnSiteName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNSitesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a VpnSite. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, vpnSiteName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves the details of a VPN site. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite being retrieved. +// - options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. +func (client *VPNSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (VPNSitesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, vpnSiteName, options) + if err != nil { + return VPNSitesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSitesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSitesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesClientGetResponse, error) { + result := VPNSitesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil { + return VPNSitesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the VpnSites in a subscription. +// +// Generated from API version 2022-09-01 +// - options - VPNSitesClientListOptions contains the optional parameters for the VPNSitesClient.NewListPager method. +func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) *runtime.Pager[VPNSitesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListResponse]{ + More: func(page VPNSitesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNSitesClientListResponse) (VPNSitesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNSitesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSitesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSitesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VPNSitesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesClientListResponse, error) { + result := VPNSitesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil { + return VPNSitesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists all the vpnSites in a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager +// method. +func (client *VPNSitesClient) NewListByResourceGroupPager(resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) *runtime.Pager[VPNSitesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[VPNSitesClientListByResourceGroupResponse]{ + More: func(page VPNSitesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VPNSitesClientListByResourceGroupResponse) (VPNSitesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VPNSitesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSitesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSitesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + 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)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *VPNSitesClient) listByResourceGroupHandleResponse(resp *http.Response) (VPNSitesClientListByResourceGroupResponse, error) { + result := VPNSitesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListVPNSitesResult); err != nil { + return VPNSitesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates VpnSite tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name of the VpnSite. +// - vpnSiteName - The name of the VpnSite being updated. +// - vpnSiteParameters - Parameters supplied to update VpnSite tags. +// - options - VPNSitesClientUpdateTagsOptions contains the optional parameters for the VPNSitesClient.UpdateTags method. +func (client *VPNSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (VPNSitesClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters, options) + if err != nil { + return VPNSitesClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VPNSitesClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VPNSitesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" + 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 vpnSiteName == "" { + return nil, errors.New("parameter vpnSiteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vpnSiteName}", url.PathEscape(vpnSiteName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, vpnSiteParameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *VPNSitesClient) updateTagsHandleResponse(resp *http.Response) (VPNSitesClientUpdateTagsResponse, error) { + result := VPNSitesClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VPNSite); err != nil { + return VPNSitesClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitesconfiguration_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitesconfiguration_client.go new file mode 100644 index 00000000000..6155ebebb74 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/vpnsitesconfiguration_client.go @@ -0,0 +1,114 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// VPNSitesConfigurationClient contains the methods for the VPNSitesConfiguration group. +// Don't use this type directly, use NewVPNSitesConfigurationClient() instead. +type VPNSitesConfigurationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewVPNSitesConfigurationClient creates a new instance of VPNSitesConfigurationClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVPNSitesConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VPNSitesConfigurationClient, error) { + cl, err := arm.NewClient(moduleName+".VPNSitesConfigurationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &VPNSitesConfigurationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDownload - Gives the sas-url to download the configurations for vpn-sites in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The resource group name. +// - virtualWANName - The name of the VirtualWAN for which configuration of all vpn-sites is needed. +// - request - Parameters supplied to download vpn-sites configuration. +// - options - VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload +// method. +func (client *VPNSitesConfigurationClient) BeginDownload(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*runtime.Poller[VPNSitesConfigurationClientDownloadResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.download(ctx, resourceGroupName, virtualWANName, request, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VPNSitesConfigurationClientDownloadResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VPNSitesConfigurationClientDownloadResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Download - Gives the sas-url to download the configurations for vpn-sites in a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VPNSitesConfigurationClient) download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*http.Response, error) { + req, err := client.downloadCreateRequest(ctx, resourceGroupName, virtualWANName, request, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// downloadCreateRequest creates the Download request. +func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration" + 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 virtualWANName == "" { + return nil, errors.New("parameter virtualWANName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualWANName}", url.PathEscape(virtualWANName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, request) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/watchers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/watchers_client.go new file mode 100644 index 00000000000..45eec787da4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/watchers_client.go @@ -0,0 +1,1216 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// WatchersClient contains the methods for the NetworkWatchers group. +// Don't use this type directly, use NewWatchersClient() instead. +type WatchersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewWatchersClient creates a new instance of WatchersClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchersClient, error) { + cl, err := arm.NewClient(moduleName+".WatchersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &WatchersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCheckConnectivity - Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given +// endpoint including another VM or an arbitrary remote server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the network watcher resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that determine how the connectivity check will be performed. +// - options - WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity +// method. +func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*runtime.Poller[WatchersClientCheckConnectivityResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.checkConnectivity(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientCheckConnectivityResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientCheckConnectivityResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CheckConnectivity - Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given +// endpoint including another VM or an arbitrary remote server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) checkConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*http.Response, error) { + req, err := client.checkConnectivityCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// checkConnectivityCreateRequest creates the CheckConnectivity request. +func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, options *WatchersClientBeginCheckConnectivityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// CreateOrUpdate - Creates or updates a network watcher in the specified resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters that define the network watcher resource. +// - options - WatchersClientCreateOrUpdateOptions contains the optional parameters for the WatchersClient.CreateOrUpdate method. +func (client *WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher, options *WatchersClientCreateOrUpdateOptions) (WatchersClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return WatchersClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WatchersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher, options *WatchersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *WatchersClient) createOrUpdateHandleResponse(resp *http.Response) (WatchersClientCreateOrUpdateResponse, error) { + result := WatchersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { + return WatchersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes the specified network watcher resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. +func (client *WatchersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*runtime.Poller[WatchersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkWatcherName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes the specified network watcher resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified network watcher by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. +func (client *WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientGetOptions) (WatchersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkWatcherName, options) + if err != nil { + return WatchersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersClientGetResponse, error) { + result := WatchersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { + return WatchersClientGetResponse{}, err + } + return result, nil +} + +// BeginGetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets +// the relative latency score for internet service providers from a specified location to Azure regions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the network watcher resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that determine Azure reachability report configuration. +// - options - WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport +// method. +func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*runtime.Poller[WatchersClientGetAzureReachabilityReportResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getAzureReachabilityReport(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetAzureReachabilityReportResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetAzureReachabilityReportResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetAzureReachabilityReport - NOTE: This feature is currently in preview and still being tested for stability. Gets the +// relative latency score for internet service providers from a specified location to Azure regions. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*http.Response, error) { + req, err := client.getAzureReachabilityReportCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getAzureReachabilityReportCreateRequest creates the GetAzureReachabilityReport request. +func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the network watcher resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. +// - options - WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus +// method. +func (client *WatchersClient) BeginGetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*runtime.Poller[WatchersClientGetFlowLogStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getFlowLogStatus(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetFlowLogStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetFlowLogStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetFlowLogStatus - Queries status of flow log and traffic analytics (optional) on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*http.Response, error) { + req, err := client.getFlowLogStatusCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getFlowLogStatusCreateRequest creates the GetFlowLogStatus request. +func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, options *WatchersClientBeginGetFlowLogStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug +// network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and +// the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. +// The API returns whether traffic was allowed or denied, the rules evaluated for +// the specified flow and the evaluation results. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters to get network configuration diagnostic. +// - options - WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic +// method. +func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*runtime.Poller[WatchersClientGetNetworkConfigurationDiagnosticResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getNetworkConfigurationDiagnostic(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetNetworkConfigurationDiagnosticResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetNetworkConfigurationDiagnosticResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetNetworkConfigurationDiagnostic - Gets Network Configuration Diagnostic data to help customers understand and debug network +// behavior. It provides detailed information on what security rules were applied to a specified traffic flow and +// the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. +// The API returns whether traffic was allowed or denied, the rules evaluated for +// the specified flow and the evaluation results. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*http.Response, error) { + req, err := client.getNetworkConfigurationDiagnosticCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getNetworkConfigurationDiagnosticCreateRequest creates the GetNetworkConfigurationDiagnostic request. +func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGetNextHop - Gets the next hop from the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters that define the source and destination endpoint. +// - options - WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop +// method. +func (client *WatchersClient) BeginGetNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*runtime.Poller[WatchersClientGetNextHopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getNextHop(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetNextHopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetNextHopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetNextHop - Gets the next hop from the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*http.Response, error) { + req, err := client.getNextHopCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getNextHopCreateRequest creates the GetNextHop request. +func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters, options *WatchersClientBeginGetNextHopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// GetTopology - Gets the current network topology by resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters that define the representation of topology. +// - options - WatchersClientGetTopologyOptions contains the optional parameters for the WatchersClient.GetTopology method. +func (client *WatchersClient) GetTopology(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters, options *WatchersClientGetTopologyOptions) (WatchersClientGetTopologyResponse, error) { + req, err := client.getTopologyCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return WatchersClientGetTopologyResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientGetTopologyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchersClientGetTopologyResponse{}, runtime.NewResponseError(resp) + } + return client.getTopologyHandleResponse(resp) +} + +// getTopologyCreateRequest creates the GetTopology request. +func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters, options *WatchersClientGetTopologyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// getTopologyHandleResponse handles the GetTopology response. +func (client *WatchersClient) getTopologyHandleResponse(resp *http.Response) (WatchersClientGetTopologyResponse, error) { + result := WatchersClientGetTopologyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Topology); err != nil { + return WatchersClientGetTopologyResponse{}, err + } + return result, nil +} + +// BeginGetTroubleshooting - Initiate troubleshooting on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that define the resource to troubleshoot. +// - options - WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting +// method. +func (client *WatchersClient) BeginGetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*runtime.Poller[WatchersClientGetTroubleshootingResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getTroubleshooting(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetTroubleshootingResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetTroubleshooting - Initiate troubleshooting on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*http.Response, error) { + req, err := client.getTroubleshootingCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getTroubleshootingCreateRequest creates the GetTroubleshooting request. +func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that define the resource to query the troubleshooting result. +// - options - WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult +// method. +func (client *WatchersClient) BeginGetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*runtime.Poller[WatchersClientGetTroubleshootingResultResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getTroubleshootingResult(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetTroubleshootingResultResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetTroubleshootingResultResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetTroubleshootingResult - Get the last completed troubleshooting result on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*http.Response, error) { + req, err := client.getTroubleshootingResultCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getTroubleshootingResultCreateRequest creates the GetTroubleshootingResult request. +func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, options *WatchersClientBeginGetTroubleshootingResultOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginGetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters that define the VM to check security groups for. +// - options - WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules +// method. +func (client *WatchersClient) BeginGetVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*runtime.Poller[WatchersClientGetVMSecurityRulesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getVMSecurityRules(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientGetVMSecurityRulesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientGetVMSecurityRulesResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetVMSecurityRules - Gets the configured and effective security group rules on the specified VM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) getVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*http.Response, error) { + req, err := client.getVMSecurityRulesCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getVMSecurityRulesCreateRequest creates the GetVMSecurityRules request. +func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, options *WatchersClientBeginGetVMSecurityRulesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// NewListPager - Gets all network watchers by resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - WatchersClientListOptions contains the optional parameters for the WatchersClient.NewListPager method. +func (client *WatchersClient) NewListPager(resourceGroupName string, options *WatchersClientListOptions) *runtime.Pager[WatchersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[WatchersClientListResponse]{ + More: func(page WatchersClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *WatchersClientListResponse) (WatchersClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, options) + if err != nil { + return WatchersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WatchersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersClientListResponse, error) { + result := WatchersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil { + return WatchersClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all network watchers by subscription. +// +// Generated from API version 2022-09-01 +// - options - WatchersClientListAllOptions contains the optional parameters for the WatchersClient.NewListAllPager method. +func (client *WatchersClient) NewListAllPager(options *WatchersClientListAllOptions) *runtime.Pager[WatchersClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[WatchersClientListAllResponse]{ + More: func(page WatchersClientListAllResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *WatchersClientListAllResponse) (WatchersClientListAllResponse, error) { + req, err := client.listAllCreateRequest(ctx, options) + if err != nil { + return WatchersClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchersClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options *WatchersClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *WatchersClient) listAllHandleResponse(resp *http.Response) (WatchersClientListAllResponse, error) { + result := WatchersClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WatcherListResult); err != nil { + return WatchersClientListAllResponse{}, err + } + return result, nil +} + +// BeginListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all +// available internet service providers for a specified Azure region. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the network watcher resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that scope the list of available providers. +// - options - WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders +// method. +func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*runtime.Poller[WatchersClientListAvailableProvidersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listAvailableProviders(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientListAvailableProvidersResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientListAvailableProvidersResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ListAvailableProviders - NOTE: This feature is currently in preview and still being tested for stability. Lists all available +// internet service providers for a specified Azure region. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) listAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*http.Response, error) { + req, err := client.listAvailableProvidersCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listAvailableProvidersCreateRequest creates the ListAvailableProviders request. +func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, options *WatchersClientBeginListAvailableProvidersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginSetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the network watcher resource group. +// - networkWatcherName - The name of the network watcher resource. +// - parameters - Parameters that define the configuration of flow log. +// - options - WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration +// method. +func (client *WatchersClient) BeginSetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*runtime.Poller[WatchersClientSetFlowLogConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.setFlowLogConfiguration(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientSetFlowLogConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientSetFlowLogConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// SetFlowLogConfiguration - Configures flow log and traffic analytics (optional) on a specified resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) setFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*http.Response, error) { + req, err := client.setFlowLogConfigurationCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// setFlowLogConfigurationCreateRequest creates the SetFlowLogConfiguration request. +func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// UpdateTags - Updates a network watcher tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters supplied to update network watcher tags. +// - options - WatchersClientUpdateTagsOptions contains the optional parameters for the WatchersClient.UpdateTags method. +func (client *WatchersClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject, options *WatchersClientUpdateTagsOptions) (WatchersClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return WatchersClientUpdateTagsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WatchersClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchersClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject, options *WatchersClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *WatchersClient) updateTagsHandleResponse(resp *http.Response) (WatchersClientUpdateTagsResponse, error) { + result := WatchersClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Watcher); err != nil { + return WatchersClientUpdateTagsResponse{}, err + } + return result, nil +} + +// BeginVerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - networkWatcherName - The name of the network watcher. +// - parameters - Parameters that define the IP flow to be verified. +// - options - WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow +// method. +func (client *WatchersClient) BeginVerifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*runtime.Poller[WatchersClientVerifyIPFlowResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.verifyIPFlow(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WatchersClientVerifyIPFlowResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WatchersClientVerifyIPFlowResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// VerifyIPFlow - Verify IP flow from the specified VM to a location given the currently configured NSG rules. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WatchersClient) verifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*http.Response, error) { + req, err := client.verifyIPFlowCreateRequest(ctx, resourceGroupName, networkWatcherName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// verifyIPFlowCreateRequest creates the VerifyIPFlow request. +func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, options *WatchersClientBeginVerifyIPFlowOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkWatcherName == "" { + return nil, errors.New("parameter networkWatcherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webapplicationfirewallpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webapplicationfirewallpolicies_client.go new file mode 100644 index 00000000000..1d357afaefd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webapplicationfirewallpolicies_client.go @@ -0,0 +1,355 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// WebApplicationFirewallPoliciesClient contains the methods for the WebApplicationFirewallPolicies group. +// Don't use this type directly, use NewWebApplicationFirewallPoliciesClient() instead. +type WebApplicationFirewallPoliciesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewWebApplicationFirewallPoliciesClient creates a new instance of WebApplicationFirewallPoliciesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewWebApplicationFirewallPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebApplicationFirewallPoliciesClient, error) { + cl, err := arm.NewClient(moduleName+".WebApplicationFirewallPoliciesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &WebApplicationFirewallPoliciesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or update policy with specified rule set name within a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - policyName - The name of the policy. +// - parameters - Policy to be created. +// - options - WebApplicationFirewallPoliciesClientCreateOrUpdateOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.CreateOrUpdate +// method. +func (client *WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy, options *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (WebApplicationFirewallPoliciesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, policyName, parameters, options) + if err != nil { + return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy, options *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if policyName == "" { + return nil, errors.New("parameter policyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *WebApplicationFirewallPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientCreateOrUpdateResponse, error) { + result := WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicy); err != nil { + return WebApplicationFirewallPoliciesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - policyName - The name of the policy. +// - options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete +// method. +func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*runtime.Poller[WebApplicationFirewallPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, policyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WebApplicationFirewallPoliciesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[WebApplicationFirewallPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, policyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if policyName == "" { + return nil, errors.New("parameter policyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieve protection policy with specified name within a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - policyName - The name of the policy. +// - options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get +// method. +func (client *WebApplicationFirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientGetOptions) (WebApplicationFirewallPoliciesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, policyName, options) + if err != nil { + return WebApplicationFirewallPoliciesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebApplicationFirewallPoliciesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebApplicationFirewallPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if policyName == "" { + return nil, errors.New("parameter policyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(policyName)) + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientGetResponse, error) { + result := WebApplicationFirewallPoliciesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicy); err != nil { + return WebApplicationFirewallPoliciesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all of the protection policies within a resource group. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. +// - options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager +// method. +func (client *WebApplicationFirewallPoliciesClient) NewListPager(resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[WebApplicationFirewallPoliciesClientListResponse]{ + More: func(page WebApplicationFirewallPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WebApplicationFirewallPoliciesClientListResponse) (WebApplicationFirewallPoliciesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WebApplicationFirewallPoliciesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebApplicationFirewallPoliciesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebApplicationFirewallPoliciesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientListResponse, error) { + result := WebApplicationFirewallPoliciesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicyListResult); err != nil { + return WebApplicationFirewallPoliciesClientListResponse{}, err + } + return result, nil +} + +// NewListAllPager - Gets all the WAF policies in a subscription. +// +// Generated from API version 2022-09-01 +// - options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager +// method. +func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { + return runtime.NewPager(runtime.PagingHandler[WebApplicationFirewallPoliciesClientListAllResponse]{ + More: func(page WebApplicationFirewallPoliciesClientListAllResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WebApplicationFirewallPoliciesClientListAllResponse) (WebApplicationFirewallPoliciesClientListAllResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAllCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WebApplicationFirewallPoliciesClientListAllResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebApplicationFirewallPoliciesClientListAllResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebApplicationFirewallPoliciesClientListAllResponse{}, runtime.NewResponseError(resp) + } + return client.listAllHandleResponse(resp) + }, + }) +} + +// listAllCreateRequest creates the ListAll request. +func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *WebApplicationFirewallPoliciesClientListAllOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllHandleResponse handles the ListAll response. +func (client *WebApplicationFirewallPoliciesClient) listAllHandleResponse(resp *http.Response) (WebApplicationFirewallPoliciesClientListAllResponse, error) { + result := WebApplicationFirewallPoliciesClientListAllResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WebApplicationFirewallPolicyListResult); err != nil { + return WebApplicationFirewallPoliciesClientListAllResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webcategories_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webcategories_client.go new file mode 100644 index 00000000000..73e02a4e1e2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2/webcategories_client.go @@ -0,0 +1,161 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armnetwork + +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" +) + +// WebCategoriesClient contains the methods for the WebCategories group. +// Don't use this type directly, use NewWebCategoriesClient() instead. +type WebCategoriesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewWebCategoriesClient creates a new instance of WebCategoriesClient with the specified values. +// - subscriptionID - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription +// ID forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewWebCategoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebCategoriesClient, error) { + cl, err := arm.NewClient(moduleName+".WebCategoriesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &WebCategoriesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the specified Azure Web Category. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - name - The name of the azureWebCategory. +// - options - WebCategoriesClientGetOptions contains the optional parameters for the WebCategoriesClient.Get method. +func (client *WebCategoriesClient) Get(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (WebCategoriesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, name, options) + if err != nil { + return WebCategoriesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebCategoriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebCategoriesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name string, options *WebCategoriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}" + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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", "2022-09-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *WebCategoriesClient) getHandleResponse(resp *http.Response) (WebCategoriesClientGetResponse, error) { + result := WebCategoriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureWebCategory); err != nil { + return WebCategoriesClientGetResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets all the Azure Web Categories in a subscription. +// +// Generated from API version 2022-09-01 +// - options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager +// method. +func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[WebCategoriesClientListBySubscriptionResponse]{ + More: func(page WebCategoriesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WebCategoriesClientListBySubscriptionResponse) (WebCategoriesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WebCategoriesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WebCategoriesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebCategoriesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WebCategoriesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories" + 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", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *WebCategoriesClient) listBySubscriptionHandleResponse(resp *http.Response) (WebCategoriesClientListBySubscriptionResponse, error) { + result := WebCategoriesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureWebCategoryListResult); err != nil { + return WebCategoriesClientListBySubscriptionResponse{}, err + } + return result, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 8409a1e6e57..3b774b7ac76 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -19,6 +19,10 @@ github.com/Azure/azure-sdk-for-go/version # github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 ## explicit; go 1.18 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/arm/internal/resource +github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy +github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log @@ -45,6 +49,9 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/log github.com/Azure/azure-sdk-for-go/sdk/internal/poller github.com/Azure/azure-sdk-for-go/sdk/internal/temporal github.com/Azure/azure-sdk-for-go/sdk/internal/uuid +# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 +## explicit; go 1.18 +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 # github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 ## explicit; go 1.16 github.com/Azure/go-ansiterm