diff --git a/go.mod b/go.mod index ba6b2ab0..c4551e22 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/terraform-exec v0.18.1 github.com/hashicorp/terraform-json v0.17.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 - github.com/magodo/aztft v0.3.1-0.20230721030203-db4a4bcab2b3 + github.com/magodo/aztft v0.3.1-0.20230825031936-c246852b4337 github.com/magodo/tfadd v0.10.1-0.20230512075749-9c0bab46fdb8 github.com/mitchellh/cli v1.1.5 github.com/zclconf/go-cty v1.13.2 @@ -44,6 +44,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights v1.1.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeploymentscripts v1.0.0 // indirect diff --git a/go.sum b/go.sum index 66f750ae..f00775c4 100644 --- a/go.sum +++ b/go.sum @@ -57,6 +57,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights v1.1.1 h1:2fNJSfRbULkn3BzwWcA5WO1wHDr6E14LkCiWHdkpfR4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights v1.1.1/go.mod h1:A5GfDiLHjdNwpQ2DLX6QNKt/wJJfOoLz4cB7JyUapxw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw v1.0.0 h1:IqQ4hSk2c+ukY8np3ta4wMaWZWYvBnAk2uo1m87bTg0= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw v1.0.0/go.mod h1:0x6XhaUEGlx5bfqrFsopXuA4B6/GhqD+GZusSeMTgFg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup v1.0.0 h1:MgsdbI063vhtsJMMCZSY6TcxFopiEhPMJEJ2L5iDva0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup v1.0.0/go.mod h1:65T59IeW3MusDYTq3zjvzzipDyct3UbWTZVL31go+Ww= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery v1.1.0 h1:x02t6z6v5+zdGuaMSpKQTn/5ok60bbzX6mPAlaeuuW8= @@ -186,8 +188,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3 h1:ob6vk6PlChZvutcxcLnmPH/VNmJEuwz+TmCYCVtJqeA= github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3/go.mod h1:rR8E7zfGMbmfnSQvrkFiWYdhrfTqsVSltelnZB09BwA= -github.com/magodo/aztft v0.3.1-0.20230721030203-db4a4bcab2b3 h1:4EZmHVlzJkpxAzIptNoTpjz/D64JKQT3UsbBA+3YJto= -github.com/magodo/aztft v0.3.1-0.20230721030203-db4a4bcab2b3/go.mod h1:Iy8TZv9TJJdDK9lYBW14uPp3Eokn4Ro7a7bXrY3LBoo= +github.com/magodo/aztft v0.3.1-0.20230825031936-c246852b4337 h1:QFN7uYf31jurkxjOpTbTIYAtQ0Ux2ajjacOS0rTuOnY= +github.com/magodo/aztft v0.3.1-0.20230825031936-c246852b4337/go.mod h1:MZJT8lF7teMYXp8I5yWucRDd6XNl63tMIAtc7XS746g= github.com/magodo/tfadd v0.10.1-0.20230512075749-9c0bab46fdb8 h1:GWxGiCXPxOpekP5dBrPMQTfF7KdmwQ7EPlBeohJlPgo= github.com/magodo/tfadd v0.10.1-0.20230512075749-9c0bab46fdb8/go.mod h1:DbJnYhmAkyjNnVt819cytTfJMtv5DpqV9MkHuUbyv3c= github.com/magodo/tfpluginschema v0.0.0-20220905090502-2d6a05ebaefd h1:L0kTduNwpx60EdBPYOVF9oUY7jdfZHIncvQN490qWd4= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md new file mode 100644 index 00000000..887cde9f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md @@ -0,0 +1,12 @@ +# Release History + +## 1.0.0 (2023-07-14) +### Other Changes + +- Release stable version. + +## 0.1.0 (2023-04-28) + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/LICENSE.txt new file mode 100644 index 00000000..dc0c2ffb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/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/paloaltonetworksngfw/armpanngfw/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/README.md new file mode 100644 index 00000000..da161be9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/README.md @@ -0,0 +1,85 @@ +# Azure PaloAltoNetworks Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw) + +The `armpanngfw` module provides operations for working with Azure PaloAltoNetworks. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw) + +# 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 PaloAltoNetworks module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure PaloAltoNetworks. 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 PaloAltoNetworks 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 := armpanngfw.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 := armpanngfw.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.NewLocalRulesClient() +``` + +## 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 `PaloAltoNetworks` 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/paloaltonetworksngfw/armpanngfw/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md new file mode 100644 index 00000000..2725d4b3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 1.0.0 +tag: package-2022-08-29 +``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/build.go new file mode 100644 index 00000000..ce99c541 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/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 -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/paloaltonetworksngfw/armpanngfw + +package armpanngfw diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go new file mode 100644 index 00000000..d5f2ac89 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go @@ -0,0 +1,284 @@ +//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 armpanngfw + +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" +) + +// CertificateObjectGlobalRulestackClient contains the methods for the CertificateObjectGlobalRulestack group. +// Don't use this type directly, use NewCertificateObjectGlobalRulestackClient() instead. +type CertificateObjectGlobalRulestackClient struct { + internal *arm.Client +} + +// NewCertificateObjectGlobalRulestackClient creates a new instance of CertificateObjectGlobalRulestackClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCertificateObjectGlobalRulestackClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificateObjectGlobalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".CertificateObjectGlobalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CertificateObjectGlobalRulestackClient{ + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a CertificateObjectGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - certificate name +// - resource - Resource create parameters. +// - options - CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.BeginCreateOrUpdate +// method. +func (client *CertificateObjectGlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, name string, resource CertificateObjectGlobalRulestackResource, options *CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a CertificateObjectGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *CertificateObjectGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource CertificateObjectGlobalRulestackResource, options *CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, 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 *CertificateObjectGlobalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, name string, resource CertificateObjectGlobalRulestackResource, options *CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/certificates/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a CertificateObjectGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - certificate name +// - options - CertificateObjectGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.BeginDelete +// method. +func (client *CertificateObjectGlobalRulestackClient) BeginDelete(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientBeginDeleteOptions) (*runtime.Poller[CertificateObjectGlobalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[CertificateObjectGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a CertificateObjectGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *CertificateObjectGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, 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 *CertificateObjectGlobalRulestackClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/certificates/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a CertificateObjectGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - certificate name +// - options - CertificateObjectGlobalRulestackClientGetOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.Get +// method. +func (client *CertificateObjectGlobalRulestackClient) Get(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientGetOptions) (CertificateObjectGlobalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) + if err != nil { + return CertificateObjectGlobalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CertificateObjectGlobalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificateObjectGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CertificateObjectGlobalRulestackClient) getCreateRequest(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/certificates/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CertificateObjectGlobalRulestackClient) getHandleResponse(resp *http.Response) (CertificateObjectGlobalRulestackClientGetResponse, error) { + result := CertificateObjectGlobalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateObjectGlobalRulestackResource); err != nil { + return CertificateObjectGlobalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List CertificateObjectGlobalRulestackResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - CertificateObjectGlobalRulestackClientListOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.NewListPager +// method. +func (client *CertificateObjectGlobalRulestackClient) NewListPager(globalRulestackName string, options *CertificateObjectGlobalRulestackClientListOptions) *runtime.Pager[CertificateObjectGlobalRulestackClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CertificateObjectGlobalRulestackClientListResponse]{ + More: func(page CertificateObjectGlobalRulestackClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CertificateObjectGlobalRulestackClientListResponse) (CertificateObjectGlobalRulestackClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, globalRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CertificateObjectGlobalRulestackClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CertificateObjectGlobalRulestackClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificateObjectGlobalRulestackClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CertificateObjectGlobalRulestackClient) listCreateRequest(ctx context.Context, globalRulestackName string, options *CertificateObjectGlobalRulestackClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/certificates" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CertificateObjectGlobalRulestackClient) listHandleResponse(resp *http.Response) (CertificateObjectGlobalRulestackClientListResponse, error) { + result := CertificateObjectGlobalRulestackClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateObjectGlobalRulestackResourceListResult); err != nil { + return CertificateObjectGlobalRulestackClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go new file mode 100644 index 00000000..ac6a57f3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_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 armpanngfw + +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" +) + +// CertificateObjectLocalRulestackClient contains the methods for the CertificateObjectLocalRulestack group. +// Don't use this type directly, use NewCertificateObjectLocalRulestackClient() instead. +type CertificateObjectLocalRulestackClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCertificateObjectLocalRulestackClient creates a new instance of CertificateObjectLocalRulestackClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCertificateObjectLocalRulestackClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificateObjectLocalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".CertificateObjectLocalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CertificateObjectLocalRulestackClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a CertificateObjectLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - certificate name +// - resource - Resource create parameters. +// - options - CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.BeginCreateOrUpdate +// method. +func (client *CertificateObjectLocalRulestackClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource CertificateObjectLocalRulestackResource, options *CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[CertificateObjectLocalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[CertificateObjectLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a CertificateObjectLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *CertificateObjectLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource CertificateObjectLocalRulestackResource, options *CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, 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 *CertificateObjectLocalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource CertificateObjectLocalRulestackResource, options *CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/certificates/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a CertificateObjectLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - certificate name +// - options - CertificateObjectLocalRulestackClientBeginDeleteOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.BeginDelete +// method. +func (client *CertificateObjectLocalRulestackClient) BeginDelete(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientBeginDeleteOptions) (*runtime.Poller[CertificateObjectLocalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[CertificateObjectLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a CertificateObjectLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *CertificateObjectLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, 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 *CertificateObjectLocalRulestackClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/certificates/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a CertificateObjectLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - certificate name +// - options - CertificateObjectLocalRulestackClientGetOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.Get +// method. +func (client *CertificateObjectLocalRulestackClient) Get(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientGetOptions) (CertificateObjectLocalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return CertificateObjectLocalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CertificateObjectLocalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificateObjectLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CertificateObjectLocalRulestackClient) getCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/certificates/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CertificateObjectLocalRulestackClient) getHandleResponse(resp *http.Response) (CertificateObjectLocalRulestackClientGetResponse, error) { + result := CertificateObjectLocalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateObjectLocalRulestackResource); err != nil { + return CertificateObjectLocalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListByLocalRulestacksPager - List CertificateObjectLocalRulestackResource resources by LocalRulestacks +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - CertificateObjectLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.NewListByLocalRulestacksPager +// method. +func (client *CertificateObjectLocalRulestackClient) NewListByLocalRulestacksPager(resourceGroupName string, localRulestackName string, options *CertificateObjectLocalRulestackClientListByLocalRulestacksOptions) *runtime.Pager[CertificateObjectLocalRulestackClientListByLocalRulestacksResponse] { + return runtime.NewPager(runtime.PagingHandler[CertificateObjectLocalRulestackClientListByLocalRulestacksResponse]{ + More: func(page CertificateObjectLocalRulestackClientListByLocalRulestacksResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CertificateObjectLocalRulestackClientListByLocalRulestacksResponse) (CertificateObjectLocalRulestackClientListByLocalRulestacksResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocalRulestacksCreateRequest(ctx, resourceGroupName, localRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CertificateObjectLocalRulestackClientListByLocalRulestacksResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CertificateObjectLocalRulestackClientListByLocalRulestacksResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificateObjectLocalRulestackClientListByLocalRulestacksResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocalRulestacksHandleResponse(resp) + }, + }) +} + +// listByLocalRulestacksCreateRequest creates the ListByLocalRulestacks request. +func (client *CertificateObjectLocalRulestackClient) listByLocalRulestacksCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *CertificateObjectLocalRulestackClientListByLocalRulestacksOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/certificates" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocalRulestacksHandleResponse handles the ListByLocalRulestacks response. +func (client *CertificateObjectLocalRulestackClient) listByLocalRulestacksHandleResponse(resp *http.Response) (CertificateObjectLocalRulestackClientListByLocalRulestacksResponse, error) { + result := CertificateObjectLocalRulestackClientListByLocalRulestacksResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateObjectLocalRulestackResourceListResult); err != nil { + return CertificateObjectLocalRulestackClientListByLocalRulestacksResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/ci.yml new file mode 100644 index 00000000..b997139e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/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/paloaltonetworksngfw/armpanngfw/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/paloaltonetworksngfw/armpanngfw' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go new file mode 100644 index 00000000..f6fe0e83 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.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 armpanngfw + +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 ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, 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) NewGlobalRulestackClient() *GlobalRulestackClient { + subClient, _ := NewGlobalRulestackClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCertificateObjectGlobalRulestackClient() *CertificateObjectGlobalRulestackClient { + subClient, _ := NewCertificateObjectGlobalRulestackClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFqdnListGlobalRulestackClient() *FqdnListGlobalRulestackClient { + subClient, _ := NewFqdnListGlobalRulestackClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPostRulesClient() *PostRulesClient { + subClient, _ := NewPostRulesClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrefixListGlobalRulestackClient() *PrefixListGlobalRulestackClient { + subClient, _ := NewPrefixListGlobalRulestackClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPreRulesClient() *PreRulesClient { + subClient, _ := NewPreRulesClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallsClient() *FirewallsClient { + subClient, _ := NewFirewallsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLocalRulestacksClient() *LocalRulestacksClient { + subClient, _ := NewLocalRulestacksClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFirewallStatusClient() *FirewallStatusClient { + subClient, _ := NewFirewallStatusClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCertificateObjectLocalRulestackClient() *CertificateObjectLocalRulestackClient { + subClient, _ := NewCertificateObjectLocalRulestackClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewFqdnListLocalRulestackClient() *FqdnListLocalRulestackClient { + subClient, _ := NewFqdnListLocalRulestackClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewLocalRulesClient() *LocalRulesClient { + subClient, _ := NewLocalRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPrefixListLocalRulestackClient() *PrefixListLocalRulestackClient { + subClient, _ := NewPrefixListLocalRulestackClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go new file mode 100644 index 00000000..1df73b4d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go @@ -0,0 +1,488 @@ +//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 armpanngfw + +const ( + moduleName = "armpanngfw" + moduleVersion = "v1.0.0" +) + +type ActionEnum string + +const ( + ActionEnumAllow ActionEnum = "Allow" + ActionEnumDenyResetBoth ActionEnum = "DenyResetBoth" + ActionEnumDenyResetServer ActionEnum = "DenyResetServer" + ActionEnumDenySilent ActionEnum = "DenySilent" +) + +// PossibleActionEnumValues returns the possible values for the ActionEnum const type. +func PossibleActionEnumValues() []ActionEnum { + return []ActionEnum{ + ActionEnumAllow, + ActionEnumDenyResetBoth, + ActionEnumDenyResetServer, + ActionEnumDenySilent, + } +} + +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +type AdvSecurityObjectTypeEnum string + +const ( + AdvSecurityObjectTypeEnumFeeds AdvSecurityObjectTypeEnum = "feeds" + AdvSecurityObjectTypeEnumURLCustom AdvSecurityObjectTypeEnum = "urlCustom" +) + +// PossibleAdvSecurityObjectTypeEnumValues returns the possible values for the AdvSecurityObjectTypeEnum const type. +func PossibleAdvSecurityObjectTypeEnumValues() []AdvSecurityObjectTypeEnum { + return []AdvSecurityObjectTypeEnum{ + AdvSecurityObjectTypeEnumFeeds, + AdvSecurityObjectTypeEnumURLCustom, + } +} + +// BillingCycle - Billing cycle +type BillingCycle string + +const ( + BillingCycleMONTHLY BillingCycle = "MONTHLY" + BillingCycleWEEKLY BillingCycle = "WEEKLY" +) + +// PossibleBillingCycleValues returns the possible values for the BillingCycle const type. +func PossibleBillingCycleValues() []BillingCycle { + return []BillingCycle{ + BillingCycleMONTHLY, + BillingCycleWEEKLY, + } +} + +// BooleanEnum - Boolean Enum +type BooleanEnum string + +const ( + BooleanEnumFALSE BooleanEnum = "FALSE" + BooleanEnumTRUE BooleanEnum = "TRUE" +) + +// PossibleBooleanEnumValues returns the possible values for the BooleanEnum const type. +func PossibleBooleanEnumValues() []BooleanEnum { + return []BooleanEnum{ + BooleanEnumFALSE, + BooleanEnumTRUE, + } +} + +// 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, + } +} + +// DNSProxy - DNS Proxy +type DNSProxy string + +const ( + DNSProxyDISABLED DNSProxy = "DISABLED" + DNSProxyENABLED DNSProxy = "ENABLED" +) + +// PossibleDNSProxyValues returns the possible values for the DNSProxy const type. +func PossibleDNSProxyValues() []DNSProxy { + return []DNSProxy{ + DNSProxyDISABLED, + DNSProxyENABLED, + } +} + +type DecryptionRuleTypeEnum string + +const ( + DecryptionRuleTypeEnumNone DecryptionRuleTypeEnum = "None" + DecryptionRuleTypeEnumSSLInboundInspection DecryptionRuleTypeEnum = "SSLInboundInspection" + DecryptionRuleTypeEnumSSLOutboundInspection DecryptionRuleTypeEnum = "SSLOutboundInspection" +) + +// PossibleDecryptionRuleTypeEnumValues returns the possible values for the DecryptionRuleTypeEnum const type. +func PossibleDecryptionRuleTypeEnumValues() []DecryptionRuleTypeEnum { + return []DecryptionRuleTypeEnum{ + DecryptionRuleTypeEnumNone, + DecryptionRuleTypeEnumSSLInboundInspection, + DecryptionRuleTypeEnumSSLOutboundInspection, + } +} + +// DefaultMode - Type for Default Mode for rules creation +type DefaultMode string + +const ( + DefaultModeFIREWALL DefaultMode = "FIREWALL" + DefaultModeIPS DefaultMode = "IPS" + DefaultModeNONE DefaultMode = "NONE" +) + +// PossibleDefaultModeValues returns the possible values for the DefaultMode const type. +func PossibleDefaultModeValues() []DefaultMode { + return []DefaultMode{ + DefaultModeFIREWALL, + DefaultModeIPS, + DefaultModeNONE, + } +} + +// EgressNat - Egress NAT +type EgressNat string + +const ( + EgressNatDISABLED EgressNat = "DISABLED" + EgressNatENABLED EgressNat = "ENABLED" +) + +// PossibleEgressNatValues returns the possible values for the EgressNat const type. +func PossibleEgressNatValues() []EgressNat { + return []EgressNat{ + EgressNatDISABLED, + EgressNatENABLED, + } +} + +// EnabledDNSType - Enabled DNS type values +type EnabledDNSType string + +const ( + EnabledDNSTypeAZURE EnabledDNSType = "AZURE" + EnabledDNSTypeCUSTOM EnabledDNSType = "CUSTOM" +) + +// PossibleEnabledDNSTypeValues returns the possible values for the EnabledDNSType const type. +func PossibleEnabledDNSTypeValues() []EnabledDNSType { + return []EnabledDNSType{ + EnabledDNSTypeAZURE, + EnabledDNSTypeCUSTOM, + } +} + +// HealthStatus - Status Codes for the Firewall +type HealthStatus string + +const ( + HealthStatusGREEN HealthStatus = "GREEN" + HealthStatusINITIALIZING HealthStatus = "INITIALIZING" + HealthStatusRED HealthStatus = "RED" + HealthStatusYELLOW HealthStatus = "YELLOW" +) + +// PossibleHealthStatusValues returns the possible values for the HealthStatus const type. +func PossibleHealthStatusValues() []HealthStatus { + return []HealthStatus{ + HealthStatusGREEN, + HealthStatusINITIALIZING, + HealthStatusRED, + HealthStatusYELLOW, + } +} + +// LogOption - Log options possible +type LogOption string + +const ( + LogOptionINDIVIDUALDESTINATION LogOption = "INDIVIDUAL_DESTINATION" + LogOptionSAMEDESTINATION LogOption = "SAME_DESTINATION" +) + +// PossibleLogOptionValues returns the possible values for the LogOption const type. +func PossibleLogOptionValues() []LogOption { + return []LogOption{ + LogOptionINDIVIDUALDESTINATION, + LogOptionSAMEDESTINATION, + } +} + +// LogType - Possible log types +type LogType string + +const ( + LogTypeAUDIT LogType = "AUDIT" + LogTypeDECRYPTION LogType = "DECRYPTION" + LogTypeDLP LogType = "DLP" + LogTypeTHREAT LogType = "THREAT" + LogTypeTRAFFIC LogType = "TRAFFIC" + LogTypeWILDFIRE LogType = "WILDFIRE" +) + +// PossibleLogTypeValues returns the possible values for the LogType const type. +func PossibleLogTypeValues() []LogType { + return []LogType{ + LogTypeAUDIT, + LogTypeDECRYPTION, + LogTypeDLP, + LogTypeTHREAT, + LogTypeTRAFFIC, + LogTypeWILDFIRE, + } +} + +// ManagedIdentityType - The kind of managed identity assigned to this resource. +type ManagedIdentityType string + +const ( + ManagedIdentityTypeNone ManagedIdentityType = "None" + ManagedIdentityTypeSystemAndUserAssigned ManagedIdentityType = "SystemAssigned,UserAssigned" + ManagedIdentityTypeSystemAssigned ManagedIdentityType = "SystemAssigned" + ManagedIdentityTypeUserAssigned ManagedIdentityType = "UserAssigned" +) + +// PossibleManagedIdentityTypeValues returns the possible values for the ManagedIdentityType const type. +func PossibleManagedIdentityTypeValues() []ManagedIdentityType { + return []ManagedIdentityType{ + ManagedIdentityTypeNone, + ManagedIdentityTypeSystemAndUserAssigned, + ManagedIdentityTypeSystemAssigned, + ManagedIdentityTypeUserAssigned, + } +} + +// MarketplaceSubscriptionStatus - Marketplace Subscription Status +type MarketplaceSubscriptionStatus string + +const ( + MarketplaceSubscriptionStatusFulfillmentRequested MarketplaceSubscriptionStatus = "FulfillmentRequested" + MarketplaceSubscriptionStatusNotStarted MarketplaceSubscriptionStatus = "NotStarted" + MarketplaceSubscriptionStatusPendingFulfillmentStart MarketplaceSubscriptionStatus = "PendingFulfillmentStart" + MarketplaceSubscriptionStatusSubscribed MarketplaceSubscriptionStatus = "Subscribed" + MarketplaceSubscriptionStatusSuspended MarketplaceSubscriptionStatus = "Suspended" + MarketplaceSubscriptionStatusUnsubscribed MarketplaceSubscriptionStatus = "Unsubscribed" +) + +// PossibleMarketplaceSubscriptionStatusValues returns the possible values for the MarketplaceSubscriptionStatus const type. +func PossibleMarketplaceSubscriptionStatusValues() []MarketplaceSubscriptionStatus { + return []MarketplaceSubscriptionStatus{ + MarketplaceSubscriptionStatusFulfillmentRequested, + MarketplaceSubscriptionStatusNotStarted, + MarketplaceSubscriptionStatusPendingFulfillmentStart, + MarketplaceSubscriptionStatusSubscribed, + MarketplaceSubscriptionStatusSuspended, + MarketplaceSubscriptionStatusUnsubscribed, + } +} + +// NetworkType - NetworkType Enum +type NetworkType string + +const ( + NetworkTypeVNET NetworkType = "VNET" + NetworkTypeVWAN NetworkType = "VWAN" +) + +// PossibleNetworkTypeValues returns the possible values for the NetworkType const type. +func PossibleNetworkTypeValues() []NetworkType { + return []NetworkType{ + NetworkTypeVNET, + NetworkTypeVWAN, + } +} + +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// ProtocolType - Protocol Enum +type ProtocolType string + +const ( + ProtocolTypeTCP ProtocolType = "TCP" + ProtocolTypeUDP ProtocolType = "UDP" +) + +// PossibleProtocolTypeValues returns the possible values for the ProtocolType const type. +func PossibleProtocolTypeValues() []ProtocolType { + return []ProtocolType{ + ProtocolTypeTCP, + ProtocolTypeUDP, + } +} + +// ProvisioningState - Provisioning state of the firewall resource. +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleted ProvisioningState = "Deleted" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateAccepted, + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateDeleted, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateNotSpecified, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// ReadOnlyProvisioningState - Provisioning state of the firewall resource. +type ReadOnlyProvisioningState string + +const ( + ReadOnlyProvisioningStateDeleted ReadOnlyProvisioningState = "Deleted" + ReadOnlyProvisioningStateFailed ReadOnlyProvisioningState = "Failed" + ReadOnlyProvisioningStateSucceeded ReadOnlyProvisioningState = "Succeeded" +) + +// PossibleReadOnlyProvisioningStateValues returns the possible values for the ReadOnlyProvisioningState const type. +func PossibleReadOnlyProvisioningStateValues() []ReadOnlyProvisioningState { + return []ReadOnlyProvisioningState{ + ReadOnlyProvisioningStateDeleted, + ReadOnlyProvisioningStateFailed, + ReadOnlyProvisioningStateSucceeded, + } +} + +// ScopeType - Rulestack Type +type ScopeType string + +const ( + ScopeTypeGLOBAL ScopeType = "GLOBAL" + ScopeTypeLOCAL ScopeType = "LOCAL" +) + +// PossibleScopeTypeValues returns the possible values for the ScopeType const type. +func PossibleScopeTypeValues() []ScopeType { + return []ScopeType{ + ScopeTypeGLOBAL, + ScopeTypeLOCAL, + } +} + +type SecurityServicesTypeEnum string + +const ( + SecurityServicesTypeEnumAntiSpyware SecurityServicesTypeEnum = "antiSpyware" + SecurityServicesTypeEnumAntiVirus SecurityServicesTypeEnum = "antiVirus" + SecurityServicesTypeEnumDNSSubscription SecurityServicesTypeEnum = "dnsSubscription" + SecurityServicesTypeEnumFileBlocking SecurityServicesTypeEnum = "fileBlocking" + SecurityServicesTypeEnumIPsVulnerability SecurityServicesTypeEnum = "ipsVulnerability" + SecurityServicesTypeEnumURLFiltering SecurityServicesTypeEnum = "urlFiltering" +) + +// PossibleSecurityServicesTypeEnumValues returns the possible values for the SecurityServicesTypeEnum const type. +func PossibleSecurityServicesTypeEnumValues() []SecurityServicesTypeEnum { + return []SecurityServicesTypeEnum{ + SecurityServicesTypeEnumAntiSpyware, + SecurityServicesTypeEnumAntiVirus, + SecurityServicesTypeEnumDNSSubscription, + SecurityServicesTypeEnumFileBlocking, + SecurityServicesTypeEnumIPsVulnerability, + SecurityServicesTypeEnumURLFiltering, + } +} + +// ServerStatus - Connectivity Status for Panorama Server +type ServerStatus string + +const ( + ServerStatusDOWN ServerStatus = "DOWN" + ServerStatusUP ServerStatus = "UP" +) + +// PossibleServerStatusValues returns the possible values for the ServerStatus const type. +func PossibleServerStatusValues() []ServerStatus { + return []ServerStatus{ + ServerStatusDOWN, + ServerStatusUP, + } +} + +// StateEnum - Enabled or Disabled Enum +type StateEnum string + +const ( + StateEnumDISABLED StateEnum = "DISABLED" + StateEnumENABLED StateEnum = "ENABLED" +) + +// PossibleStateEnumValues returns the possible values for the StateEnum const type. +func PossibleStateEnumValues() []StateEnum { + return []StateEnum{ + StateEnumDISABLED, + StateEnumENABLED, + } +} + +// UsageType - Usage Type +type UsageType string + +const ( + UsageTypeCOMMITTED UsageType = "COMMITTED" + UsageTypePAYG UsageType = "PAYG" +) + +// PossibleUsageTypeValues returns the possible values for the UsageType const type. +func PossibleUsageTypeValues() []UsageType { + return []UsageType{ + UsageTypeCOMMITTED, + UsageTypePAYG, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go new file mode 100644 index 00000000..2621a405 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go @@ -0,0 +1,647 @@ +//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 armpanngfw + +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" +) + +// FirewallsClient contains the methods for the Firewalls group. +// Don't use this type directly, use NewFirewallsClient() instead. +type FirewallsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallsClient creates a new instance of FirewallsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallsClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - resource - Resource create parameters. +// - options - FirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallsClient.BeginCreateOrUpdate +// method. +func (client *FirewallsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, firewallName string, resource FirewallResource, options *FirewallsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FirewallsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, firewallName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallName string, resource FirewallResource, options *FirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallName, resource, 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 *FirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, resource FirewallResource, options *FirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientBeginDeleteOptions contains the optional parameters for the FirewallsClient.BeginDelete method. +func (client *FirewallsClient) BeginDelete(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientBeginDeleteOptions) (*runtime.Poller[FirewallsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, firewallName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FirewallsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallName, 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 *FirewallsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientGetOptions contains the optional parameters for the FirewallsClient.Get method. +func (client *FirewallsClient) Get(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetOptions) (FirewallsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FirewallsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FirewallsClient) getHandleResponse(resp *http.Response) (FirewallsClientGetResponse, error) { + result := FirewallsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallResource); err != nil { + return FirewallsClientGetResponse{}, err + } + return result, nil +} + +// GetGlobalRulestack - Get Global Rulestack associated with the Firewall +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientGetGlobalRulestackOptions contains the optional parameters for the FirewallsClient.GetGlobalRulestack +// method. +func (client *FirewallsClient) GetGlobalRulestack(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetGlobalRulestackOptions) (FirewallsClientGetGlobalRulestackResponse, error) { + req, err := client.getGlobalRulestackCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallsClientGetGlobalRulestackResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientGetGlobalRulestackResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientGetGlobalRulestackResponse{}, runtime.NewResponseError(resp) + } + return client.getGlobalRulestackHandleResponse(resp) +} + +// getGlobalRulestackCreateRequest creates the GetGlobalRulestack request. +func (client *FirewallsClient) getGlobalRulestackCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetGlobalRulestackOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/getGlobalRulestack" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getGlobalRulestackHandleResponse handles the GetGlobalRulestack response. +func (client *FirewallsClient) getGlobalRulestackHandleResponse(resp *http.Response) (FirewallsClientGetGlobalRulestackResponse, error) { + result := FirewallsClientGetGlobalRulestackResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalRulestackInfo); err != nil { + return FirewallsClientGetGlobalRulestackResponse{}, err + } + return result, nil +} + +// GetLogProfile - Log Profile for Firewall +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientGetLogProfileOptions contains the optional parameters for the FirewallsClient.GetLogProfile method. +func (client *FirewallsClient) GetLogProfile(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetLogProfileOptions) (FirewallsClientGetLogProfileResponse, error) { + req, err := client.getLogProfileCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallsClientGetLogProfileResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientGetLogProfileResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientGetLogProfileResponse{}, runtime.NewResponseError(resp) + } + return client.getLogProfileHandleResponse(resp) +} + +// getLogProfileCreateRequest creates the GetLogProfile request. +func (client *FirewallsClient) getLogProfileCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetLogProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/getLogProfile" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getLogProfileHandleResponse handles the GetLogProfile response. +func (client *FirewallsClient) getLogProfileHandleResponse(resp *http.Response) (FirewallsClientGetLogProfileResponse, error) { + result := FirewallsClientGetLogProfileResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogSettings); err != nil { + return FirewallsClientGetLogProfileResponse{}, err + } + return result, nil +} + +// GetSupportInfo - support info for firewall. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientGetSupportInfoOptions contains the optional parameters for the FirewallsClient.GetSupportInfo +// method. +func (client *FirewallsClient) GetSupportInfo(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetSupportInfoOptions) (FirewallsClientGetSupportInfoResponse, error) { + req, err := client.getSupportInfoCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallsClientGetSupportInfoResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientGetSupportInfoResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientGetSupportInfoResponse{}, runtime.NewResponseError(resp) + } + return client.getSupportInfoHandleResponse(resp) +} + +// getSupportInfoCreateRequest creates the GetSupportInfo request. +func (client *FirewallsClient) getSupportInfoCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientGetSupportInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/getSupportInfo" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + if options != nil && options.Email != nil { + reqQP.Set("email", *options.Email) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getSupportInfoHandleResponse handles the GetSupportInfo response. +func (client *FirewallsClient) getSupportInfoHandleResponse(resp *http.Response) (FirewallsClientGetSupportInfoResponse, error) { + result := FirewallsClientGetSupportInfoResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SupportInfo); err != nil { + return FirewallsClientGetSupportInfoResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List FirewallResource resources by resource group +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - FirewallsClientListByResourceGroupOptions contains the optional parameters for the FirewallsClient.NewListByResourceGroupPager +// method. +func (client *FirewallsClient) NewListByResourceGroupPager(resourceGroupName string, options *FirewallsClientListByResourceGroupOptions) *runtime.Pager[FirewallsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallsClientListByResourceGroupResponse]{ + More: func(page FirewallsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallsClientListByResourceGroupResponse) (FirewallsClientListByResourceGroupResponse, 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 FirewallsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *FirewallsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *FirewallsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls" + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *FirewallsClient) listByResourceGroupHandleResponse(resp *http.Response) (FirewallsClientListByResourceGroupResponse, error) { + result := FirewallsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallResourceListResult); err != nil { + return FirewallsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List FirewallResource resources by subscription ID +// +// Generated from API version 2022-08-29 +// - options - FirewallsClientListBySubscriptionOptions contains the optional parameters for the FirewallsClient.NewListBySubscriptionPager +// method. +func (client *FirewallsClient) NewListBySubscriptionPager(options *FirewallsClientListBySubscriptionOptions) *runtime.Pager[FirewallsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallsClientListBySubscriptionResponse]{ + More: func(page FirewallsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallsClientListBySubscriptionResponse) (FirewallsClientListBySubscriptionResponse, 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 FirewallsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *FirewallsClient) listBySubscriptionCreateRequest(ctx context.Context, options *FirewallsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/PaloAltoNetworks.Cloudngfw/firewalls" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *FirewallsClient) listBySubscriptionHandleResponse(resp *http.Response) (FirewallsClientListBySubscriptionResponse, error) { + result := FirewallsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallResourceListResult); err != nil { + return FirewallsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// SaveLogProfile - Log Profile for Firewall +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallsClientSaveLogProfileOptions contains the optional parameters for the FirewallsClient.SaveLogProfile +// method. +func (client *FirewallsClient) SaveLogProfile(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientSaveLogProfileOptions) (FirewallsClientSaveLogProfileResponse, error) { + req, err := client.saveLogProfileCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallsClientSaveLogProfileResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientSaveLogProfileResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return FirewallsClientSaveLogProfileResponse{}, runtime.NewResponseError(resp) + } + return FirewallsClientSaveLogProfileResponse{}, nil +} + +// saveLogProfileCreateRequest creates the SaveLogProfile request. +func (client *FirewallsClient) saveLogProfileCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientSaveLogProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/saveLogProfile" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.LogSettings != nil { + return req, runtime.MarshalAsJSON(req, *options.LogSettings) + } + return req, nil +} + +// Update - Update a FirewallResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - properties - The resource properties to be updated. +// - options - FirewallsClientUpdateOptions contains the optional parameters for the FirewallsClient.Update method. +func (client *FirewallsClient) Update(ctx context.Context, resourceGroupName string, firewallName string, properties FirewallResourceUpdate, options *FirewallsClientUpdateOptions) (FirewallsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, firewallName, properties, options) + if err != nil { + return FirewallsClientUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *FirewallsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, properties FirewallResourceUpdate, options *FirewallsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + +// updateHandleResponse handles the Update response. +func (client *FirewallsClient) updateHandleResponse(resp *http.Response) (FirewallsClientUpdateResponse, error) { + result := FirewallsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallResource); err != nil { + return FirewallsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go new file mode 100644 index 00000000..f272d104 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go @@ -0,0 +1,172 @@ +//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 armpanngfw + +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" +) + +// FirewallStatusClient contains the methods for the FirewallStatus group. +// Don't use this type directly, use NewFirewallStatusClient() instead. +type FirewallStatusClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFirewallStatusClient creates a new instance of FirewallStatusClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFirewallStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallStatusClient, error) { + cl, err := arm.NewClient(moduleName+".FirewallStatusClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FirewallStatusClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a FirewallStatusResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallStatusClientGetOptions contains the optional parameters for the FirewallStatusClient.Get method. +func (client *FirewallStatusClient) Get(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallStatusClientGetOptions) (FirewallStatusClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, firewallName, options) + if err != nil { + return FirewallStatusClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallStatusClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallStatusClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FirewallStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallStatusClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/statuses/default" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FirewallStatusClient) getHandleResponse(resp *http.Response) (FirewallStatusClientGetResponse, error) { + result := FirewallStatusClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallStatusResource); err != nil { + return FirewallStatusClientGetResponse{}, err + } + return result, nil +} + +// NewListByFirewallsPager - List FirewallStatusResource resources by Firewalls +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - firewallName - Firewall resource name +// - options - FirewallStatusClientListByFirewallsOptions contains the optional parameters for the FirewallStatusClient.NewListByFirewallsPager +// method. +func (client *FirewallStatusClient) NewListByFirewallsPager(resourceGroupName string, firewallName string, options *FirewallStatusClientListByFirewallsOptions) *runtime.Pager[FirewallStatusClientListByFirewallsResponse] { + return runtime.NewPager(runtime.PagingHandler[FirewallStatusClientListByFirewallsResponse]{ + More: func(page FirewallStatusClientListByFirewallsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FirewallStatusClientListByFirewallsResponse) (FirewallStatusClientListByFirewallsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByFirewallsCreateRequest(ctx, resourceGroupName, firewallName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FirewallStatusClientListByFirewallsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FirewallStatusClientListByFirewallsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FirewallStatusClientListByFirewallsResponse{}, runtime.NewResponseError(resp) + } + return client.listByFirewallsHandleResponse(resp) + }, + }) +} + +// listByFirewallsCreateRequest creates the ListByFirewalls request. +func (client *FirewallStatusClient) listByFirewallsCreateRequest(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallStatusClientListByFirewallsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName}/statuses" + 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 firewallName == "" { + return nil, errors.New("parameter firewallName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{firewallName}", url.PathEscape(firewallName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByFirewallsHandleResponse handles the ListByFirewalls response. +func (client *FirewallStatusClient) listByFirewallsHandleResponse(resp *http.Response) (FirewallStatusClientListByFirewallsResponse, error) { + result := FirewallStatusClientListByFirewallsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FirewallStatusResourceListResult); err != nil { + return FirewallStatusClientListByFirewallsResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go new file mode 100644 index 00000000..96a1f7e7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go @@ -0,0 +1,284 @@ +//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 armpanngfw + +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" +) + +// FqdnListGlobalRulestackClient contains the methods for the FqdnListGlobalRulestack group. +// Don't use this type directly, use NewFqdnListGlobalRulestackClient() instead. +type FqdnListGlobalRulestackClient struct { + internal *arm.Client +} + +// NewFqdnListGlobalRulestackClient creates a new instance of FqdnListGlobalRulestackClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFqdnListGlobalRulestackClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*FqdnListGlobalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".FqdnListGlobalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FqdnListGlobalRulestackClient{ + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a FqdnListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - fqdn list name +// - resource - Resource create parameters. +// - options - FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the FqdnListGlobalRulestackClient.BeginCreateOrUpdate +// method. +func (client *FqdnListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, name string, resource FqdnListGlobalRulestackResource, options *FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[FqdnListGlobalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FqdnListGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a FqdnListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FqdnListGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource FqdnListGlobalRulestackResource, options *FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, 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 *FqdnListGlobalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, name string, resource FqdnListGlobalRulestackResource, options *FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/fqdnlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a FqdnListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - fqdn list name +// - options - FqdnListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the FqdnListGlobalRulestackClient.BeginDelete +// method. +func (client *FqdnListGlobalRulestackClient) BeginDelete(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientBeginDeleteOptions) (*runtime.Poller[FqdnListGlobalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FqdnListGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a FqdnListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FqdnListGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, 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 *FqdnListGlobalRulestackClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/fqdnlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a FqdnListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - fqdn list name +// - options - FqdnListGlobalRulestackClientGetOptions contains the optional parameters for the FqdnListGlobalRulestackClient.Get +// method. +func (client *FqdnListGlobalRulestackClient) Get(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientGetOptions) (FqdnListGlobalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) + if err != nil { + return FqdnListGlobalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FqdnListGlobalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FqdnListGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FqdnListGlobalRulestackClient) getCreateRequest(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/fqdnlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FqdnListGlobalRulestackClient) getHandleResponse(resp *http.Response) (FqdnListGlobalRulestackClientGetResponse, error) { + result := FqdnListGlobalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FqdnListGlobalRulestackResource); err != nil { + return FqdnListGlobalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List FqdnListGlobalRulestackResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - FqdnListGlobalRulestackClientListOptions contains the optional parameters for the FqdnListGlobalRulestackClient.NewListPager +// method. +func (client *FqdnListGlobalRulestackClient) NewListPager(globalRulestackName string, options *FqdnListGlobalRulestackClientListOptions) *runtime.Pager[FqdnListGlobalRulestackClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FqdnListGlobalRulestackClientListResponse]{ + More: func(page FqdnListGlobalRulestackClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FqdnListGlobalRulestackClientListResponse) (FqdnListGlobalRulestackClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, globalRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FqdnListGlobalRulestackClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FqdnListGlobalRulestackClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FqdnListGlobalRulestackClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *FqdnListGlobalRulestackClient) listCreateRequest(ctx context.Context, globalRulestackName string, options *FqdnListGlobalRulestackClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/fqdnlists" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FqdnListGlobalRulestackClient) listHandleResponse(resp *http.Response) (FqdnListGlobalRulestackClientListResponse, error) { + result := FqdnListGlobalRulestackClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FqdnListGlobalRulestackResourceListResult); err != nil { + return FqdnListGlobalRulestackClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go new file mode 100644 index 00000000..d1fe4f15 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_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 armpanngfw + +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" +) + +// FqdnListLocalRulestackClient contains the methods for the FqdnListLocalRulestack group. +// Don't use this type directly, use NewFqdnListLocalRulestackClient() instead. +type FqdnListLocalRulestackClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFqdnListLocalRulestackClient creates a new instance of FqdnListLocalRulestackClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFqdnListLocalRulestackClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FqdnListLocalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".FqdnListLocalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FqdnListLocalRulestackClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a FqdnListLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - fqdn list name +// - resource - Resource create parameters. +// - options - FqdnListLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the FqdnListLocalRulestackClient.BeginCreateOrUpdate +// method. +func (client *FqdnListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource FqdnListLocalRulestackResource, options *FqdnListLocalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[FqdnListLocalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FqdnListLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a FqdnListLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FqdnListLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource FqdnListLocalRulestackResource, options *FqdnListLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, 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 *FqdnListLocalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource FqdnListLocalRulestackResource, options *FqdnListLocalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/fqdnlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a FqdnListLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - fqdn list name +// - options - FqdnListLocalRulestackClientBeginDeleteOptions contains the optional parameters for the FqdnListLocalRulestackClient.BeginDelete +// method. +func (client *FqdnListLocalRulestackClient) BeginDelete(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientBeginDeleteOptions) (*runtime.Poller[FqdnListLocalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[FqdnListLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a FqdnListLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *FqdnListLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, 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 *FqdnListLocalRulestackClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/fqdnlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a FqdnListLocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - fqdn list name +// - options - FqdnListLocalRulestackClientGetOptions contains the optional parameters for the FqdnListLocalRulestackClient.Get +// method. +func (client *FqdnListLocalRulestackClient) Get(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientGetOptions) (FqdnListLocalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return FqdnListLocalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FqdnListLocalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FqdnListLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *FqdnListLocalRulestackClient) getCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/fqdnlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FqdnListLocalRulestackClient) getHandleResponse(resp *http.Response) (FqdnListLocalRulestackClientGetResponse, error) { + result := FqdnListLocalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FqdnListLocalRulestackResource); err != nil { + return FqdnListLocalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListByLocalRulestacksPager - List FqdnListLocalRulestackResource resources by LocalRulestacks +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - FqdnListLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the FqdnListLocalRulestackClient.NewListByLocalRulestacksPager +// method. +func (client *FqdnListLocalRulestackClient) NewListByLocalRulestacksPager(resourceGroupName string, localRulestackName string, options *FqdnListLocalRulestackClientListByLocalRulestacksOptions) *runtime.Pager[FqdnListLocalRulestackClientListByLocalRulestacksResponse] { + return runtime.NewPager(runtime.PagingHandler[FqdnListLocalRulestackClientListByLocalRulestacksResponse]{ + More: func(page FqdnListLocalRulestackClientListByLocalRulestacksResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FqdnListLocalRulestackClientListByLocalRulestacksResponse) (FqdnListLocalRulestackClientListByLocalRulestacksResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocalRulestacksCreateRequest(ctx, resourceGroupName, localRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return FqdnListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FqdnListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return FqdnListLocalRulestackClientListByLocalRulestacksResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocalRulestacksHandleResponse(resp) + }, + }) +} + +// listByLocalRulestacksCreateRequest creates the ListByLocalRulestacks request. +func (client *FqdnListLocalRulestackClient) listByLocalRulestacksCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *FqdnListLocalRulestackClientListByLocalRulestacksOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/fqdnlists" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocalRulestacksHandleResponse handles the ListByLocalRulestacks response. +func (client *FqdnListLocalRulestackClient) listByLocalRulestacksHandleResponse(resp *http.Response) (FqdnListLocalRulestackClientListByLocalRulestacksResponse, error) { + result := FqdnListLocalRulestackClientListByLocalRulestacksResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FqdnListLocalRulestackResourceListResult); err != nil { + return FqdnListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go new file mode 100644 index 00000000..e2071d0f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go @@ -0,0 +1,791 @@ +//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 armpanngfw + +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" +) + +// GlobalRulestackClient contains the methods for the GlobalRulestack group. +// Don't use this type directly, use NewGlobalRulestackClient() instead. +type GlobalRulestackClient struct { + internal *arm.Client +} + +// NewGlobalRulestackClient creates a new instance of GlobalRulestackClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGlobalRulestackClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".GlobalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GlobalRulestackClient{ + internal: cl, + } + return client, nil +} + +// BeginCommit - Commit rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientBeginCommitOptions contains the optional parameters for the GlobalRulestackClient.BeginCommit +// method. +func (client *GlobalRulestackClient) BeginCommit(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginCommitOptions) (*runtime.Poller[GlobalRulestackClientCommitResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.commit(ctx, globalRulestackName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCommitResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GlobalRulestackClientCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Commit - Commit rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *GlobalRulestackClient) commit(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginCommitOptions) (*http.Response, error) { + req, err := client.commitCreateRequest(ctx, globalRulestackName, 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 +} + +// commitCreateRequest creates the Commit request. +func (client *GlobalRulestackClient) commitCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginCommitOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/commit" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginCreateOrUpdate - Create a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - resource - Resource create parameters. +// - options - GlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalRulestackClient.BeginCreateOrUpdate +// method. +func (client *GlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, resource GlobalRulestackResource, options *GlobalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[GlobalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[GlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *GlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, resource GlobalRulestackResource, options *GlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, resource, 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 *GlobalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, resource GlobalRulestackResource, options *GlobalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientBeginDeleteOptions contains the optional parameters for the GlobalRulestackClient.BeginDelete +// method. +func (client *GlobalRulestackClient) BeginDelete(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginDeleteOptions) (*runtime.Poller[GlobalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[GlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *GlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, 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 *GlobalRulestackClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientGetOptions contains the optional parameters for the GlobalRulestackClient.Get method. +func (client *GlobalRulestackClient) Get(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientGetOptions) (GlobalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GlobalRulestackClient) getCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GlobalRulestackClient) getHandleResponse(resp *http.Response) (GlobalRulestackClientGetResponse, error) { + result := GlobalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalRulestackResource); err != nil { + return GlobalRulestackClientGetResponse{}, err + } + return result, nil +} + +// GetChangeLog - Get changelog +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientGetChangeLogOptions contains the optional parameters for the GlobalRulestackClient.GetChangeLog +// method. +func (client *GlobalRulestackClient) GetChangeLog(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientGetChangeLogOptions) (GlobalRulestackClientGetChangeLogResponse, error) { + req, err := client.getChangeLogCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientGetChangeLogResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientGetChangeLogResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientGetChangeLogResponse{}, runtime.NewResponseError(resp) + } + return client.getChangeLogHandleResponse(resp) +} + +// getChangeLogCreateRequest creates the GetChangeLog request. +func (client *GlobalRulestackClient) getChangeLogCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientGetChangeLogOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/getChangeLog" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getChangeLogHandleResponse handles the GetChangeLog response. +func (client *GlobalRulestackClient) getChangeLogHandleResponse(resp *http.Response) (GlobalRulestackClientGetChangeLogResponse, error) { + result := GlobalRulestackClientGetChangeLogResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Changelog); err != nil { + return GlobalRulestackClientGetChangeLogResponse{}, err + } + return result, nil +} + +// NewListPager - List GlobalRulestackResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - options - GlobalRulestackClientListOptions contains the optional parameters for the GlobalRulestackClient.NewListPager +// method. +func (client *GlobalRulestackClient) NewListPager(options *GlobalRulestackClientListOptions) *runtime.Pager[GlobalRulestackClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GlobalRulestackClientListResponse]{ + More: func(page GlobalRulestackClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GlobalRulestackClientListResponse) (GlobalRulestackClientListResponse, 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 GlobalRulestackClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GlobalRulestackClient) listCreateRequest(ctx context.Context, options *GlobalRulestackClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GlobalRulestackClient) listHandleResponse(resp *http.Response) (GlobalRulestackClientListResponse, error) { + result := GlobalRulestackClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalRulestackResourceListResult); err != nil { + return GlobalRulestackClientListResponse{}, err + } + return result, nil +} + +// ListAdvancedSecurityObjects - Get the list of advanced security objects +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListAdvancedSecurityObjectsOptions contains the optional parameters for the GlobalRulestackClient.ListAdvancedSecurityObjects +// method. +func (client *GlobalRulestackClient) ListAdvancedSecurityObjects(ctx context.Context, globalRulestackName string, typeParam AdvSecurityObjectTypeEnum, options *GlobalRulestackClientListAdvancedSecurityObjectsOptions) (GlobalRulestackClientListAdvancedSecurityObjectsResponse, error) { + req, err := client.listAdvancedSecurityObjectsCreateRequest(ctx, globalRulestackName, typeParam, options) + if err != nil { + return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, runtime.NewResponseError(resp) + } + return client.listAdvancedSecurityObjectsHandleResponse(resp) +} + +// listAdvancedSecurityObjectsCreateRequest creates the ListAdvancedSecurityObjects request. +func (client *GlobalRulestackClient) listAdvancedSecurityObjectsCreateRequest(ctx context.Context, globalRulestackName string, typeParam AdvSecurityObjectTypeEnum, options *GlobalRulestackClientListAdvancedSecurityObjectsOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listAdvancedSecurityObjects" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + if options != nil && options.Top != nil { + reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("type", string(typeParam)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAdvancedSecurityObjectsHandleResponse handles the ListAdvancedSecurityObjects response. +func (client *GlobalRulestackClient) listAdvancedSecurityObjectsHandleResponse(resp *http.Response) (GlobalRulestackClientListAdvancedSecurityObjectsResponse, error) { + result := GlobalRulestackClientListAdvancedSecurityObjectsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdvSecurityObjectListResponse); err != nil { + return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err + } + return result, nil +} + +// ListAppIDs - List of AppIds for GlobalRulestack ApiVersion +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListAppIDsOptions contains the optional parameters for the GlobalRulestackClient.ListAppIDs +// method. +func (client *GlobalRulestackClient) ListAppIDs(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListAppIDsOptions) (GlobalRulestackClientListAppIDsResponse, error) { + req, err := client.listAppIDsCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientListAppIDsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListAppIDsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListAppIDsResponse{}, runtime.NewResponseError(resp) + } + return client.listAppIDsHandleResponse(resp) +} + +// listAppIDsCreateRequest creates the ListAppIDs request. +func (client *GlobalRulestackClient) listAppIDsCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListAppIDsOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listAppIds" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + if options != nil && options.AppIDVersion != nil { + reqQP.Set("appIdVersion", *options.AppIDVersion) + } + if options != nil && options.AppPrefix != nil { + reqQP.Set("appPrefix", *options.AppPrefix) + } + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listAppIDsHandleResponse handles the ListAppIDs response. +func (client *GlobalRulestackClient) listAppIDsHandleResponse(resp *http.Response) (GlobalRulestackClientListAppIDsResponse, error) { + result := GlobalRulestackClientListAppIDsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListAppIDResponse); err != nil { + return GlobalRulestackClientListAppIDsResponse{}, err + } + return result, nil +} + +// ListCountries - List of countries for Rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListCountriesOptions contains the optional parameters for the GlobalRulestackClient.ListCountries +// method. +func (client *GlobalRulestackClient) ListCountries(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListCountriesOptions) (GlobalRulestackClientListCountriesResponse, error) { + req, err := client.listCountriesCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientListCountriesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListCountriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListCountriesResponse{}, runtime.NewResponseError(resp) + } + return client.listCountriesHandleResponse(resp) +} + +// listCountriesCreateRequest creates the ListCountries request. +func (client *GlobalRulestackClient) listCountriesCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListCountriesOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listCountries" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listCountriesHandleResponse handles the ListCountries response. +func (client *GlobalRulestackClient) listCountriesHandleResponse(resp *http.Response) (GlobalRulestackClientListCountriesResponse, error) { + result := GlobalRulestackClientListCountriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CountriesResponse); err != nil { + return GlobalRulestackClientListCountriesResponse{}, err + } + return result, nil +} + +// ListFirewalls - List of Firewalls associated with Rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListFirewallsOptions contains the optional parameters for the GlobalRulestackClient.ListFirewalls +// method. +func (client *GlobalRulestackClient) ListFirewalls(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListFirewallsOptions) (GlobalRulestackClientListFirewallsResponse, error) { + req, err := client.listFirewallsCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientListFirewallsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListFirewallsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListFirewallsResponse{}, runtime.NewResponseError(resp) + } + return client.listFirewallsHandleResponse(resp) +} + +// listFirewallsCreateRequest creates the ListFirewalls request. +func (client *GlobalRulestackClient) listFirewallsCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListFirewallsOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listFirewalls" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listFirewallsHandleResponse handles the ListFirewalls response. +func (client *GlobalRulestackClient) listFirewallsHandleResponse(resp *http.Response) (GlobalRulestackClientListFirewallsResponse, error) { + result := GlobalRulestackClientListFirewallsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListFirewallsResponse); err != nil { + return GlobalRulestackClientListFirewallsResponse{}, err + } + return result, nil +} + +// ListPredefinedURLCategories - List predefined URL categories for rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListPredefinedURLCategoriesOptions contains the optional parameters for the GlobalRulestackClient.ListPredefinedURLCategories +// method. +func (client *GlobalRulestackClient) ListPredefinedURLCategories(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListPredefinedURLCategoriesOptions) (GlobalRulestackClientListPredefinedURLCategoriesResponse, error) { + req, err := client.listPredefinedURLCategoriesCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, runtime.NewResponseError(resp) + } + return client.listPredefinedURLCategoriesHandleResponse(resp) +} + +// listPredefinedURLCategoriesCreateRequest creates the ListPredefinedURLCategories request. +func (client *GlobalRulestackClient) listPredefinedURLCategoriesCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientListPredefinedURLCategoriesOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listPredefinedUrlCategories" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listPredefinedURLCategoriesHandleResponse handles the ListPredefinedURLCategories response. +func (client *GlobalRulestackClient) listPredefinedURLCategoriesHandleResponse(resp *http.Response) (GlobalRulestackClientListPredefinedURLCategoriesResponse, error) { + result := GlobalRulestackClientListPredefinedURLCategoriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PredefinedURLCategoriesResponse); err != nil { + return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err + } + return result, nil +} + +// ListSecurityServices - List the security services for rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientListSecurityServicesOptions contains the optional parameters for the GlobalRulestackClient.ListSecurityServices +// method. +func (client *GlobalRulestackClient) ListSecurityServices(ctx context.Context, globalRulestackName string, typeParam SecurityServicesTypeEnum, options *GlobalRulestackClientListSecurityServicesOptions) (GlobalRulestackClientListSecurityServicesResponse, error) { + req, err := client.listSecurityServicesCreateRequest(ctx, globalRulestackName, typeParam, options) + if err != nil { + return GlobalRulestackClientListSecurityServicesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientListSecurityServicesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientListSecurityServicesResponse{}, runtime.NewResponseError(resp) + } + return client.listSecurityServicesHandleResponse(resp) +} + +// listSecurityServicesCreateRequest creates the ListSecurityServices request. +func (client *GlobalRulestackClient) listSecurityServicesCreateRequest(ctx context.Context, globalRulestackName string, typeParam SecurityServicesTypeEnum, options *GlobalRulestackClientListSecurityServicesOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/listSecurityServices" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + if options != nil && options.Top != nil { + reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("type", string(typeParam)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecurityServicesHandleResponse handles the ListSecurityServices response. +func (client *GlobalRulestackClient) listSecurityServicesHandleResponse(resp *http.Response) (GlobalRulestackClientListSecurityServicesResponse, error) { + result := GlobalRulestackClientListSecurityServicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityServicesResponse); err != nil { + return GlobalRulestackClientListSecurityServicesResponse{}, err + } + return result, nil +} + +// Revert - Revert rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - GlobalRulestackClientRevertOptions contains the optional parameters for the GlobalRulestackClient.Revert method. +func (client *GlobalRulestackClient) Revert(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientRevertOptions) (GlobalRulestackClientRevertResponse, error) { + req, err := client.revertCreateRequest(ctx, globalRulestackName, options) + if err != nil { + return GlobalRulestackClientRevertResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientRevertResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return GlobalRulestackClientRevertResponse{}, runtime.NewResponseError(resp) + } + return GlobalRulestackClientRevertResponse{}, nil +} + +// revertCreateRequest creates the Revert request. +func (client *GlobalRulestackClient) revertCreateRequest(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientRevertOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/revert" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Update - Update a GlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - properties - The resource properties to be updated. +// - options - GlobalRulestackClientUpdateOptions contains the optional parameters for the GlobalRulestackClient.Update method. +func (client *GlobalRulestackClient) Update(ctx context.Context, globalRulestackName string, properties GlobalRulestackResourceUpdate, options *GlobalRulestackClientUpdateOptions) (GlobalRulestackClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, globalRulestackName, properties, options) + if err != nil { + return GlobalRulestackClientUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GlobalRulestackClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalRulestackClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *GlobalRulestackClient) updateCreateRequest(ctx context.Context, globalRulestackName string, properties GlobalRulestackResourceUpdate, options *GlobalRulestackClientUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + +// updateHandleResponse handles the Update response. +func (client *GlobalRulestackClient) updateHandleResponse(resp *http.Response) (GlobalRulestackClientUpdateResponse, error) { + result := GlobalRulestackClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalRulestackResource); err != nil { + return GlobalRulestackClientUpdateResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go new file mode 100644 index 00000000..d41cc49c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go @@ -0,0 +1,509 @@ +//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 armpanngfw + +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" +) + +// LocalRulesClient contains the methods for the LocalRules group. +// Don't use this type directly, use NewLocalRulesClient() instead. +type LocalRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLocalRulesClient creates a new instance of LocalRulesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLocalRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalRulesClient, error) { + cl, err := arm.NewClient(moduleName+".LocalRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LocalRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a LocalRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - resource - Resource create parameters. +// - options - LocalRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalRulesClient.BeginCreateOrUpdate +// method. +func (client *LocalRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, resource LocalRulesResource, options *LocalRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[LocalRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localRulestackName, priority, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a LocalRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *LocalRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, resource LocalRulesResource, options *LocalRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, priority, resource, 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 *LocalRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, resource LocalRulesResource, options *LocalRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a LocalRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - options - LocalRulesClientBeginDeleteOptions contains the optional parameters for the LocalRulesClient.BeginDelete method. +func (client *LocalRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientBeginDeleteOptions) (*runtime.Poller[LocalRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localRulestackName, priority, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a LocalRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *LocalRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, priority, 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 *LocalRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a LocalRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - options - LocalRulesClientGetOptions contains the optional parameters for the LocalRulesClient.Get method. +func (client *LocalRulesClient) Get(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientGetOptions) (LocalRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) + if err != nil { + return LocalRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LocalRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LocalRulesClient) getHandleResponse(resp *http.Response) (LocalRulesClientGetResponse, error) { + result := LocalRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulesResource); err != nil { + return LocalRulesClientGetResponse{}, err + } + return result, nil +} + +// GetCounters - Get counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - options - LocalRulesClientGetCountersOptions contains the optional parameters for the LocalRulesClient.GetCounters method. +func (client *LocalRulesClient) GetCounters(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientGetCountersOptions) (LocalRulesClientGetCountersResponse, error) { + req, err := client.getCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) + if err != nil { + return LocalRulesClientGetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulesClientGetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.getCountersHandleResponse(resp) +} + +// getCountersCreateRequest creates the GetCounters request. +func (client *LocalRulesClient) getCountersCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientGetCountersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}/getCounters" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCountersHandleResponse handles the GetCounters response. +func (client *LocalRulesClient) getCountersHandleResponse(resp *http.Response) (LocalRulesClientGetCountersResponse, error) { + result := LocalRulesClientGetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounter); err != nil { + return LocalRulesClientGetCountersResponse{}, err + } + return result, nil +} + +// NewListByLocalRulestacksPager - List LocalRulesResource resources by LocalRulestacks +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulesClientListByLocalRulestacksOptions contains the optional parameters for the LocalRulesClient.NewListByLocalRulestacksPager +// method. +func (client *LocalRulesClient) NewListByLocalRulestacksPager(resourceGroupName string, localRulestackName string, options *LocalRulesClientListByLocalRulestacksOptions) *runtime.Pager[LocalRulesClientListByLocalRulestacksResponse] { + return runtime.NewPager(runtime.PagingHandler[LocalRulesClientListByLocalRulestacksResponse]{ + More: func(page LocalRulesClientListByLocalRulestacksResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LocalRulesClientListByLocalRulestacksResponse) (LocalRulesClientListByLocalRulestacksResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocalRulestacksCreateRequest(ctx, resourceGroupName, localRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return LocalRulesClientListByLocalRulestacksResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulesClientListByLocalRulestacksResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulesClientListByLocalRulestacksResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocalRulestacksHandleResponse(resp) + }, + }) +} + +// listByLocalRulestacksCreateRequest creates the ListByLocalRulestacks request. +func (client *LocalRulesClient) listByLocalRulestacksCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulesClientListByLocalRulestacksOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocalRulestacksHandleResponse handles the ListByLocalRulestacks response. +func (client *LocalRulesClient) listByLocalRulestacksHandleResponse(resp *http.Response) (LocalRulesClientListByLocalRulestacksResponse, error) { + result := LocalRulesClientListByLocalRulestacksResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulesResourceListResult); err != nil { + return LocalRulesClientListByLocalRulestacksResponse{}, err + } + return result, nil +} + +// RefreshCounters - Refresh counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - options - LocalRulesClientRefreshCountersOptions contains the optional parameters for the LocalRulesClient.RefreshCounters +// method. +func (client *LocalRulesClient) RefreshCounters(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientRefreshCountersOptions) (LocalRulesClientRefreshCountersResponse, error) { + req, err := client.refreshCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) + if err != nil { + return LocalRulesClientRefreshCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulesClientRefreshCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return LocalRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + } + return LocalRulesClientRefreshCountersResponse{}, nil +} + +// refreshCountersCreateRequest creates the RefreshCounters request. +func (client *LocalRulesClient) refreshCountersCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientRefreshCountersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}/refreshCounters" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// ResetCounters - Reset counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - priority - Local Rule priority +// - options - LocalRulesClientResetCountersOptions contains the optional parameters for the LocalRulesClient.ResetCounters +// method. +func (client *LocalRulesClient) ResetCounters(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientResetCountersOptions) (LocalRulesClientResetCountersResponse, error) { + req, err := client.resetCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) + if err != nil { + return LocalRulesClientResetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulesClientResetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.resetCountersHandleResponse(resp) +} + +// resetCountersCreateRequest creates the ResetCounters request. +func (client *LocalRulesClient) resetCountersCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientResetCountersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/localRules/{priority}/resetCounters" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// resetCountersHandleResponse handles the ResetCounters response. +func (client *LocalRulesClient) resetCountersHandleResponse(resp *http.Response) (LocalRulesClientResetCountersResponse, error) { + result := LocalRulesClientResetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounterReset); err != nil { + return LocalRulesClientResetCountersResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go new file mode 100644 index 00000000..8419650d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go @@ -0,0 +1,1041 @@ +//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 armpanngfw + +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" +) + +// LocalRulestacksClient contains the methods for the LocalRulestacks group. +// Don't use this type directly, use NewLocalRulestacksClient() instead. +type LocalRulestacksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLocalRulestacksClient creates a new instance of LocalRulestacksClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLocalRulestacksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalRulestacksClient, error) { + cl, err := arm.NewClient(moduleName+".LocalRulestacksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LocalRulestacksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCommit - Commit rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientBeginCommitOptions contains the optional parameters for the LocalRulestacksClient.BeginCommit +// method. +func (client *LocalRulestacksClient) BeginCommit(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginCommitOptions) (*runtime.Poller[LocalRulestacksClientCommitResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.commit(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCommitResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalRulestacksClientCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Commit - Commit rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *LocalRulestacksClient) commit(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginCommitOptions) (*http.Response, error) { + req, err := client.commitCreateRequest(ctx, resourceGroupName, localRulestackName, 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 +} + +// commitCreateRequest creates the Commit request. +func (client *LocalRulestacksClient) commitCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginCommitOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginCreateOrUpdate - Create a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - resource - Resource create parameters. +// - options - LocalRulestacksClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalRulestacksClient.BeginCreateOrUpdate +// method. +func (client *LocalRulestacksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, resource LocalRulestackResource, options *LocalRulestacksClientBeginCreateOrUpdateOptions) (*runtime.Poller[LocalRulestacksClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localRulestackName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalRulestacksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *LocalRulestacksClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, resource LocalRulestackResource, options *LocalRulestacksClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, resource, 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 *LocalRulestacksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, resource LocalRulestackResource, options *LocalRulestacksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientBeginDeleteOptions contains the optional parameters for the LocalRulestacksClient.BeginDelete +// method. +func (client *LocalRulestacksClient) BeginDelete(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginDeleteOptions) (*runtime.Poller[LocalRulestacksClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[LocalRulestacksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *LocalRulestacksClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, 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 *LocalRulestacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientGetOptions contains the optional parameters for the LocalRulestacksClient.Get method. +func (client *LocalRulestacksClient) Get(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetOptions) (LocalRulestacksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *LocalRulestacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LocalRulestacksClient) getHandleResponse(resp *http.Response) (LocalRulestacksClientGetResponse, error) { + result := LocalRulestacksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulestackResource); err != nil { + return LocalRulestacksClientGetResponse{}, err + } + return result, nil +} + +// GetChangeLog - Get changelog +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientGetChangeLogOptions contains the optional parameters for the LocalRulestacksClient.GetChangeLog +// method. +func (client *LocalRulestacksClient) GetChangeLog(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetChangeLogOptions) (LocalRulestacksClientGetChangeLogResponse, error) { + req, err := client.getChangeLogCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientGetChangeLogResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientGetChangeLogResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientGetChangeLogResponse{}, runtime.NewResponseError(resp) + } + return client.getChangeLogHandleResponse(resp) +} + +// getChangeLogCreateRequest creates the GetChangeLog request. +func (client *LocalRulestacksClient) getChangeLogCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetChangeLogOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/getChangeLog" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getChangeLogHandleResponse handles the GetChangeLog response. +func (client *LocalRulestacksClient) getChangeLogHandleResponse(resp *http.Response) (LocalRulestacksClientGetChangeLogResponse, error) { + result := LocalRulestacksClientGetChangeLogResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Changelog); err != nil { + return LocalRulestacksClientGetChangeLogResponse{}, err + } + return result, nil +} + +// GetSupportInfo - support info for rulestack. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientGetSupportInfoOptions contains the optional parameters for the LocalRulestacksClient.GetSupportInfo +// method. +func (client *LocalRulestacksClient) GetSupportInfo(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetSupportInfoOptions) (LocalRulestacksClientGetSupportInfoResponse, error) { + req, err := client.getSupportInfoCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientGetSupportInfoResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientGetSupportInfoResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientGetSupportInfoResponse{}, runtime.NewResponseError(resp) + } + return client.getSupportInfoHandleResponse(resp) +} + +// getSupportInfoCreateRequest creates the GetSupportInfo request. +func (client *LocalRulestacksClient) getSupportInfoCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientGetSupportInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/getSupportInfo" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.Email != nil { + reqQP.Set("email", *options.Email) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getSupportInfoHandleResponse handles the GetSupportInfo response. +func (client *LocalRulestacksClient) getSupportInfoHandleResponse(resp *http.Response) (LocalRulestacksClientGetSupportInfoResponse, error) { + result := LocalRulestacksClientGetSupportInfoResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SupportInfo); err != nil { + return LocalRulestacksClientGetSupportInfoResponse{}, err + } + return result, nil +} + +// ListAdvancedSecurityObjects - Get the list of advanced security objects +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListAdvancedSecurityObjectsOptions contains the optional parameters for the LocalRulestacksClient.ListAdvancedSecurityObjects +// method. +func (client *LocalRulestacksClient) ListAdvancedSecurityObjects(ctx context.Context, resourceGroupName string, localRulestackName string, typeParam AdvSecurityObjectTypeEnum, options *LocalRulestacksClientListAdvancedSecurityObjectsOptions) (LocalRulestacksClientListAdvancedSecurityObjectsResponse, error) { + req, err := client.listAdvancedSecurityObjectsCreateRequest(ctx, resourceGroupName, localRulestackName, typeParam, options) + if err != nil { + return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, runtime.NewResponseError(resp) + } + return client.listAdvancedSecurityObjectsHandleResponse(resp) +} + +// listAdvancedSecurityObjectsCreateRequest creates the ListAdvancedSecurityObjects request. +func (client *LocalRulestacksClient) listAdvancedSecurityObjectsCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, typeParam AdvSecurityObjectTypeEnum, options *LocalRulestacksClientListAdvancedSecurityObjectsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listAdvancedSecurityObjects" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + if options != nil && options.Top != nil { + reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("type", string(typeParam)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAdvancedSecurityObjectsHandleResponse handles the ListAdvancedSecurityObjects response. +func (client *LocalRulestacksClient) listAdvancedSecurityObjectsHandleResponse(resp *http.Response) (LocalRulestacksClientListAdvancedSecurityObjectsResponse, error) { + result := LocalRulestacksClientListAdvancedSecurityObjectsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AdvSecurityObjectListResponse); err != nil { + return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err + } + return result, nil +} + +// ListAppIDs - List of AppIds for LocalRulestack ApiVersion +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListAppIDsOptions contains the optional parameters for the LocalRulestacksClient.ListAppIDs +// method. +func (client *LocalRulestacksClient) ListAppIDs(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListAppIDsOptions) (LocalRulestacksClientListAppIDsResponse, error) { + req, err := client.listAppIDsCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientListAppIDsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListAppIDsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListAppIDsResponse{}, runtime.NewResponseError(resp) + } + return client.listAppIDsHandleResponse(resp) +} + +// listAppIDsCreateRequest creates the ListAppIDs request. +func (client *LocalRulestacksClient) listAppIDsCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListAppIDsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listAppIds" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.AppIDVersion != nil { + reqQP.Set("appIdVersion", *options.AppIDVersion) + } + if options != nil && options.AppPrefix != nil { + reqQP.Set("appPrefix", *options.AppPrefix) + } + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listAppIDsHandleResponse handles the ListAppIDs response. +func (client *LocalRulestacksClient) listAppIDsHandleResponse(resp *http.Response) (LocalRulestacksClientListAppIDsResponse, error) { + result := LocalRulestacksClientListAppIDsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListAppIDResponse); err != nil { + return LocalRulestacksClientListAppIDsResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List LocalRulestackResource resources by resource group +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - LocalRulestacksClientListByResourceGroupOptions contains the optional parameters for the LocalRulestacksClient.NewListByResourceGroupPager +// method. +func (client *LocalRulestacksClient) NewListByResourceGroupPager(resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) *runtime.Pager[LocalRulestacksClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[LocalRulestacksClientListByResourceGroupResponse]{ + More: func(page LocalRulestacksClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LocalRulestacksClientListByResourceGroupResponse) (LocalRulestacksClientListByResourceGroupResponse, 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 LocalRulestacksClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *LocalRulestacksClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks" + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *LocalRulestacksClient) listByResourceGroupHandleResponse(resp *http.Response) (LocalRulestacksClientListByResourceGroupResponse, error) { + result := LocalRulestacksClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulestackResourceListResult); err != nil { + return LocalRulestacksClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List LocalRulestackResource resources by subscription ID +// +// Generated from API version 2022-08-29 +// - options - LocalRulestacksClientListBySubscriptionOptions contains the optional parameters for the LocalRulestacksClient.NewListBySubscriptionPager +// method. +func (client *LocalRulestacksClient) NewListBySubscriptionPager(options *LocalRulestacksClientListBySubscriptionOptions) *runtime.Pager[LocalRulestacksClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[LocalRulestacksClientListBySubscriptionResponse]{ + More: func(page LocalRulestacksClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LocalRulestacksClientListBySubscriptionResponse) (LocalRulestacksClientListBySubscriptionResponse, 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 LocalRulestacksClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *LocalRulestacksClient) listBySubscriptionCreateRequest(ctx context.Context, options *LocalRulestacksClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *LocalRulestacksClient) listBySubscriptionHandleResponse(resp *http.Response) (LocalRulestacksClientListBySubscriptionResponse, error) { + result := LocalRulestacksClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulestackResourceListResult); err != nil { + return LocalRulestacksClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// ListCountries - List of countries for Rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListCountriesOptions contains the optional parameters for the LocalRulestacksClient.ListCountries +// method. +func (client *LocalRulestacksClient) ListCountries(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListCountriesOptions) (LocalRulestacksClientListCountriesResponse, error) { + req, err := client.listCountriesCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientListCountriesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListCountriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListCountriesResponse{}, runtime.NewResponseError(resp) + } + return client.listCountriesHandleResponse(resp) +} + +// listCountriesCreateRequest creates the ListCountries request. +func (client *LocalRulestacksClient) listCountriesCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListCountriesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listCountries" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listCountriesHandleResponse handles the ListCountries response. +func (client *LocalRulestacksClient) listCountriesHandleResponse(resp *http.Response) (LocalRulestacksClientListCountriesResponse, error) { + result := LocalRulestacksClientListCountriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CountriesResponse); err != nil { + return LocalRulestacksClientListCountriesResponse{}, err + } + return result, nil +} + +// ListFirewalls - List of Firewalls associated with Rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListFirewallsOptions contains the optional parameters for the LocalRulestacksClient.ListFirewalls +// method. +func (client *LocalRulestacksClient) ListFirewalls(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListFirewallsOptions) (LocalRulestacksClientListFirewallsResponse, error) { + req, err := client.listFirewallsCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientListFirewallsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListFirewallsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListFirewallsResponse{}, runtime.NewResponseError(resp) + } + return client.listFirewallsHandleResponse(resp) +} + +// listFirewallsCreateRequest creates the ListFirewalls request. +func (client *LocalRulestacksClient) listFirewallsCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListFirewallsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listFirewalls" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listFirewallsHandleResponse handles the ListFirewalls response. +func (client *LocalRulestacksClient) listFirewallsHandleResponse(resp *http.Response) (LocalRulestacksClientListFirewallsResponse, error) { + result := LocalRulestacksClientListFirewallsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListFirewallsResponse); err != nil { + return LocalRulestacksClientListFirewallsResponse{}, err + } + return result, nil +} + +// ListPredefinedURLCategories - List predefined URL categories for rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListPredefinedURLCategoriesOptions contains the optional parameters for the LocalRulestacksClient.ListPredefinedURLCategories +// method. +func (client *LocalRulestacksClient) ListPredefinedURLCategories(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListPredefinedURLCategoriesOptions) (LocalRulestacksClientListPredefinedURLCategoriesResponse, error) { + req, err := client.listPredefinedURLCategoriesCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientListPredefinedURLCategoriesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListPredefinedURLCategoriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListPredefinedURLCategoriesResponse{}, runtime.NewResponseError(resp) + } + return client.listPredefinedURLCategoriesHandleResponse(resp) +} + +// listPredefinedURLCategoriesCreateRequest creates the ListPredefinedURLCategories request. +func (client *LocalRulestacksClient) listPredefinedURLCategoriesCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientListPredefinedURLCategoriesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listPredefinedUrlCategories" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + 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, nil +} + +// listPredefinedURLCategoriesHandleResponse handles the ListPredefinedURLCategories response. +func (client *LocalRulestacksClient) listPredefinedURLCategoriesHandleResponse(resp *http.Response) (LocalRulestacksClientListPredefinedURLCategoriesResponse, error) { + result := LocalRulestacksClientListPredefinedURLCategoriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PredefinedURLCategoriesResponse); err != nil { + return LocalRulestacksClientListPredefinedURLCategoriesResponse{}, err + } + return result, nil +} + +// ListSecurityServices - List the security services for rulestack +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientListSecurityServicesOptions contains the optional parameters for the LocalRulestacksClient.ListSecurityServices +// method. +func (client *LocalRulestacksClient) ListSecurityServices(ctx context.Context, resourceGroupName string, localRulestackName string, typeParam SecurityServicesTypeEnum, options *LocalRulestacksClientListSecurityServicesOptions) (LocalRulestacksClientListSecurityServicesResponse, error) { + req, err := client.listSecurityServicesCreateRequest(ctx, resourceGroupName, localRulestackName, typeParam, options) + if err != nil { + return LocalRulestacksClientListSecurityServicesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientListSecurityServicesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientListSecurityServicesResponse{}, runtime.NewResponseError(resp) + } + return client.listSecurityServicesHandleResponse(resp) +} + +// listSecurityServicesCreateRequest creates the ListSecurityServices request. +func (client *LocalRulestacksClient) listSecurityServicesCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, typeParam SecurityServicesTypeEnum, options *LocalRulestacksClientListSecurityServicesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/listSecurityServices" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + if options != nil && options.Skip != nil { + reqQP.Set("skip", *options.Skip) + } + if options != nil && options.Top != nil { + reqQP.Set("top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("type", string(typeParam)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecurityServicesHandleResponse handles the ListSecurityServices response. +func (client *LocalRulestacksClient) listSecurityServicesHandleResponse(resp *http.Response) (LocalRulestacksClientListSecurityServicesResponse, error) { + result := LocalRulestacksClientListSecurityServicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityServicesResponse); err != nil { + return LocalRulestacksClientListSecurityServicesResponse{}, err + } + return result, nil +} + +// Revert - Revert rulestack configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - LocalRulestacksClientRevertOptions contains the optional parameters for the LocalRulestacksClient.Revert method. +func (client *LocalRulestacksClient) Revert(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientRevertOptions) (LocalRulestacksClientRevertResponse, error) { + req, err := client.revertCreateRequest(ctx, resourceGroupName, localRulestackName, options) + if err != nil { + return LocalRulestacksClientRevertResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientRevertResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return LocalRulestacksClientRevertResponse{}, runtime.NewResponseError(resp) + } + return LocalRulestacksClientRevertResponse{}, nil +} + +// revertCreateRequest creates the Revert request. +func (client *LocalRulestacksClient) revertCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientRevertOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/revert" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Update - Update a LocalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - properties - The resource properties to be updated. +// - options - LocalRulestacksClientUpdateOptions contains the optional parameters for the LocalRulestacksClient.Update method. +func (client *LocalRulestacksClient) Update(ctx context.Context, resourceGroupName string, localRulestackName string, properties LocalRulestackResourceUpdate, options *LocalRulestacksClientUpdateOptions) (LocalRulestacksClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, localRulestackName, properties, options) + if err != nil { + return LocalRulestacksClientUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LocalRulestacksClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LocalRulestacksClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *LocalRulestacksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, properties LocalRulestackResourceUpdate, options *LocalRulestacksClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + +// updateHandleResponse handles the Update response. +func (client *LocalRulestacksClient) updateHandleResponse(resp *http.Response) (LocalRulestacksClientUpdateResponse, error) { + result := LocalRulestacksClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LocalRulestackResource); err != nil { + return LocalRulestacksClientUpdateResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go new file mode 100644 index 00000000..d786e70d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go @@ -0,0 +1,1924 @@ +//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 armpanngfw + +import "time" + +// AdvSecurityObjectListResponse - advanced security object +type AdvSecurityObjectListResponse struct { + // REQUIRED; response value + Value *AdvSecurityObjectModel + + // next link + NextLink *string +} + +// AdvSecurityObjectModel - List of custom and predefined url category +type AdvSecurityObjectModel struct { + // REQUIRED; URL entry + Entry []*NameDescriptionObject + + // type of object + Type *string +} + +// AppSeenData - Data Type for App Seen +type AppSeenData struct { + // REQUIRED; array of appSeen + AppSeenList []*AppSeenInfo + + // REQUIRED; number of rows + Count *int32 +} + +// AppSeenInfo - Definition for App Seen +type AppSeenInfo struct { + // REQUIRED; category + Category *string + + // REQUIRED; risk + Risk *string + + // REQUIRED; standardPorts + StandardPorts *string + + // REQUIRED; subCategory + SubCategory *string + + // REQUIRED; tag + Tag *string + + // REQUIRED; technology + Technology *string + + // REQUIRED; title + Title *string +} + +// ApplicationInsights - Application Insights key +type ApplicationInsights struct { + // Resource id for Application Insights + ID *string + + // Application Insights key + Key *string +} + +// AzureResourceManagerManagedIdentityProperties - The properties of the managed service identities assigned to this resource. +type AzureResourceManagerManagedIdentityProperties struct { + // REQUIRED; The type of managed identity assigned to this resource. + Type *ManagedIdentityType + + // The identities assigned to this resource by the user. + UserAssignedIdentities map[string]*AzureResourceManagerUserAssignedIdentity + + // READ-ONLY; The active directory identifier of this principal. + PrincipalID *string + + // READ-ONLY; The Active Directory tenant id of the principal. + TenantID *string +} + +// AzureResourceManagerUserAssignedIdentity - A managed identity assigned by the user. +type AzureResourceManagerUserAssignedIdentity struct { + // The active directory client identifier for this principal. + ClientID *string + + // The active directory identifier for this principal. + PrincipalID *string +} + +// Category - URL/EDL to match +type Category struct { + // REQUIRED; feed list + Feeds []*string + + // REQUIRED; custom URL + URLCustom []*string +} + +// CertificateObject - certificate used for inbound and outbound decryption +type CertificateObject struct { + // REQUIRED; use certificate self signed + CertificateSelfSigned *BooleanEnum + + // comment for this object + AuditComment *string + + // Resource Id of certificate signer, to be populated only when certificateSelfSigned is false + CertificateSignerResourceID *string + + // user description for this object + Description *string + + // read only string representing last create or update + Etag *string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.BeginCreateOrUpdate +// method. +type CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificateObjectGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.BeginDelete +// method. +type CertificateObjectGlobalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificateObjectGlobalRulestackClientGetOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.Get +// method. +type CertificateObjectGlobalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// CertificateObjectGlobalRulestackClientListOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.NewListPager +// method. +type CertificateObjectGlobalRulestackClientListOptions struct { + // placeholder for future optional parameters +} + +// CertificateObjectGlobalRulestackResource - GlobalRulestack Certificate Object +type CertificateObjectGlobalRulestackResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *CertificateObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CertificateObjectGlobalRulestackResourceListResult - The response of a CertificateObjectGlobalRulestackResource list operation. +type CertificateObjectGlobalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*CertificateObjectGlobalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.BeginCreateOrUpdate +// method. +type CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificateObjectLocalRulestackClientBeginDeleteOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.BeginDelete +// method. +type CertificateObjectLocalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificateObjectLocalRulestackClientGetOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.Get +// method. +type CertificateObjectLocalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// CertificateObjectLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the CertificateObjectLocalRulestackClient.NewListByLocalRulestacksPager +// method. +type CertificateObjectLocalRulestackClientListByLocalRulestacksOptions struct { + // placeholder for future optional parameters +} + +// CertificateObjectLocalRulestackResource - LocalRulestack Certificate Object +type CertificateObjectLocalRulestackResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *CertificateObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CertificateObjectLocalRulestackResourceListResult - The response of a CertificateObjectLocalRulestackResource list operation. +type CertificateObjectLocalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*CertificateObjectLocalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// Changelog list +type Changelog struct { + // REQUIRED; list of changes + Changes []*string + + // lastCommitted timestamp + LastCommitted *time.Time + + // lastModified timestamp + LastModified *time.Time +} + +// CountriesResponse - Countries Response Object +type CountriesResponse struct { + // REQUIRED; List of countries + Value []*Country + + // next link + NextLink *string +} + +// Country Description +type Country struct { + // REQUIRED; country code + Code *string + + // code description + Description *string +} + +// DNSSettings - DNS Proxy settings for Firewall +type DNSSettings struct { + // List of IPs associated with the Firewall + DNSServers []*IPAddress + + // Enable DNS proxy, disabled by default + EnableDNSProxy *DNSProxy + + // Enabled DNS proxy type, disabled by default + EnabledDNSType *EnabledDNSType +} + +// DestinationAddr - destination address +type DestinationAddr struct { + // special value 'any' + Cidrs []*string + + // list of countries + Countries []*string + + // list of feeds + Feeds []*string + + // fqdn list + FqdnLists []*string + + // prefix list + PrefixLists []*string +} + +// EndpointConfiguration - Endpoint Configuration for frontend and backend +type EndpointConfiguration struct { + // REQUIRED; Address Space + Address *IPAddress + + // REQUIRED; port ID + Port *string +} + +// EventHub configurations +type EventHub struct { + // Resource ID of EventHub + ID *string + + // EventHub name + Name *string + + // EventHub namespace + NameSpace *string + + // EventHub policy name + PolicyName *string + + // Subscription Id + SubscriptionID *string +} + +// FirewallDeploymentProperties - Properties specific to the Firewall resource deployment. +type FirewallDeploymentProperties struct { + // REQUIRED; DNS settings for Firewall + DNSSettings *DNSSettings + + // REQUIRED; Marketplace details + MarketplaceDetails *MarketplaceDetails + + // REQUIRED; Network settings + NetworkProfile *NetworkProfile + + // REQUIRED; Billing plan information. + PlanData *PlanData + + // Associated Rulestack + AssociatedRulestack *RulestackDetails + + // Frontend settings for Firewall + FrontEndSettings []*FrontendSetting + + // Panorama Managed: Default is False. Default will be CloudSec managed + IsPanoramaManaged *BooleanEnum + + // panEtag info + PanEtag *string + + // Panorama Configuration + PanoramaConfig *PanoramaConfig + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// FirewallResource - PaloAltoNetworks Firewall +type FirewallResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; The resource-specific properties for this resource. + Properties *FirewallDeploymentProperties + + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FirewallResourceListResult - The response of a FirewallResource list operation. +type FirewallResourceListResult struct { + // REQUIRED; The items on this page + Value []*FirewallResource + + // The link to the next page of items + NextLink *string +} + +// FirewallResourceUpdate - The type used for update operations of the FirewallResource. +type FirewallResourceUpdate struct { + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // The updatable properties of the FirewallResource. + Properties *FirewallResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// FirewallResourceUpdateProperties - The updatable properties of the FirewallResource. +type FirewallResourceUpdateProperties struct { + // Associated Rulestack + AssociatedRulestack *RulestackDetails + + // DNS settings for Firewall + DNSSettings *DNSSettings + + // Frontend settings for Firewall + FrontEndSettings []*FrontendSetting + + // Panorama Managed: Default is False. Default will be CloudSec managed + IsPanoramaManaged *BooleanEnum + + // Marketplace details + MarketplaceDetails *MarketplaceDetails + + // Network settings + NetworkProfile *NetworkProfile + + // panEtag info + PanEtag *string + + // Panorama Configuration + PanoramaConfig *PanoramaConfig + + // Billing plan information. + PlanData *PlanData +} + +// FirewallStatusClientGetOptions contains the optional parameters for the FirewallStatusClient.Get method. +type FirewallStatusClientGetOptions struct { + // placeholder for future optional parameters +} + +// FirewallStatusClientListByFirewallsOptions contains the optional parameters for the FirewallStatusClient.NewListByFirewallsPager +// method. +type FirewallStatusClientListByFirewallsOptions struct { + // placeholder for future optional parameters +} + +// FirewallStatusProperty - Firewall Status +type FirewallStatusProperty struct { + // READ-ONLY; Detail description of current health of the Firewall + HealthReason *string + + // READ-ONLY; Current status of the Firewall + HealthStatus *HealthStatus + + // READ-ONLY; Panorama Managed: Default is False. Default will be CloudSec managed + IsPanoramaManaged *BooleanEnum + + // READ-ONLY; Panorama Status + PanoramaStatus *PanoramaStatus + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ReadOnlyProvisioningState +} + +// FirewallStatusResource - Firewall Status +type FirewallStatusResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *FirewallStatusProperty + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FirewallStatusResourceListResult - The response of a FirewallStatusResource list operation. +type FirewallStatusResourceListResult struct { + // REQUIRED; The items on this page + Value []*FirewallStatusResource + + // The link to the next page of items + NextLink *string +} + +// FirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallsClient.BeginCreateOrUpdate +// method. +type FirewallsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallsClientBeginDeleteOptions contains the optional parameters for the FirewallsClient.BeginDelete method. +type FirewallsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FirewallsClientGetGlobalRulestackOptions contains the optional parameters for the FirewallsClient.GetGlobalRulestack method. +type FirewallsClientGetGlobalRulestackOptions struct { + // placeholder for future optional parameters +} + +// FirewallsClientGetLogProfileOptions contains the optional parameters for the FirewallsClient.GetLogProfile method. +type FirewallsClientGetLogProfileOptions struct { + // placeholder for future optional parameters +} + +// FirewallsClientGetOptions contains the optional parameters for the FirewallsClient.Get method. +type FirewallsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FirewallsClientGetSupportInfoOptions contains the optional parameters for the FirewallsClient.GetSupportInfo method. +type FirewallsClientGetSupportInfoOptions struct { + // email address on behalf of which this API called + Email *string +} + +// FirewallsClientListByResourceGroupOptions contains the optional parameters for the FirewallsClient.NewListByResourceGroupPager +// method. +type FirewallsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// FirewallsClientListBySubscriptionOptions contains the optional parameters for the FirewallsClient.NewListBySubscriptionPager +// method. +type FirewallsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// FirewallsClientSaveLogProfileOptions contains the optional parameters for the FirewallsClient.SaveLogProfile method. +type FirewallsClientSaveLogProfileOptions struct { + LogSettings *LogSettings +} + +// FirewallsClientUpdateOptions contains the optional parameters for the FirewallsClient.Update method. +type FirewallsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the FqdnListGlobalRulestackClient.BeginCreateOrUpdate +// method. +type FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FqdnListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the FqdnListGlobalRulestackClient.BeginDelete +// method. +type FqdnListGlobalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FqdnListGlobalRulestackClientGetOptions contains the optional parameters for the FqdnListGlobalRulestackClient.Get method. +type FqdnListGlobalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// FqdnListGlobalRulestackClientListOptions contains the optional parameters for the FqdnListGlobalRulestackClient.NewListPager +// method. +type FqdnListGlobalRulestackClientListOptions struct { + // placeholder for future optional parameters +} + +// FqdnListGlobalRulestackResource - GlobalRulestack fqdnList +type FqdnListGlobalRulestackResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *FqdnObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FqdnListGlobalRulestackResourceListResult - The response of a FqdnListGlobalRulestackResource list operation. +type FqdnListGlobalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*FqdnListGlobalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// FqdnListLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the FqdnListLocalRulestackClient.BeginCreateOrUpdate +// method. +type FqdnListLocalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FqdnListLocalRulestackClientBeginDeleteOptions contains the optional parameters for the FqdnListLocalRulestackClient.BeginDelete +// method. +type FqdnListLocalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FqdnListLocalRulestackClientGetOptions contains the optional parameters for the FqdnListLocalRulestackClient.Get method. +type FqdnListLocalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// FqdnListLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the FqdnListLocalRulestackClient.NewListByLocalRulestacksPager +// method. +type FqdnListLocalRulestackClientListByLocalRulestacksOptions struct { + // placeholder for future optional parameters +} + +// FqdnListLocalRulestackResource - LocalRulestack fqdnList +type FqdnListLocalRulestackResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *FqdnObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FqdnListLocalRulestackResourceListResult - The response of a FqdnListLocalRulestackResource list operation. +type FqdnListLocalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*FqdnListLocalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// FqdnObject - fqdn object +type FqdnObject struct { + // REQUIRED; fqdn list + FqdnList []*string + + // comment for this object + AuditComment *string + + // fqdn object description + Description *string + + // etag info + Etag *string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// FrontendSetting - Frontend setting for Firewall +type FrontendSetting struct { + // REQUIRED; Backend configurations + BackendConfiguration *EndpointConfiguration + + // REQUIRED; Frontend configurations + FrontendConfiguration *EndpointConfiguration + + // REQUIRED; Settings name + Name *string + + // REQUIRED; Protocol Type + Protocol *ProtocolType +} + +// GlobalRulestackClientBeginCommitOptions contains the optional parameters for the GlobalRulestackClient.BeginCommit method. +type GlobalRulestackClientBeginCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalRulestackClient.BeginCreateOrUpdate +// method. +type GlobalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GlobalRulestackClientBeginDeleteOptions contains the optional parameters for the GlobalRulestackClient.BeginDelete method. +type GlobalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GlobalRulestackClientGetChangeLogOptions contains the optional parameters for the GlobalRulestackClient.GetChangeLog method. +type GlobalRulestackClientGetChangeLogOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackClientGetOptions contains the optional parameters for the GlobalRulestackClient.Get method. +type GlobalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackClientListAdvancedSecurityObjectsOptions contains the optional parameters for the GlobalRulestackClient.ListAdvancedSecurityObjects +// method. +type GlobalRulestackClientListAdvancedSecurityObjectsOptions struct { + Skip *string + Top *int32 +} + +// GlobalRulestackClientListAppIDsOptions contains the optional parameters for the GlobalRulestackClient.ListAppIDs method. +type GlobalRulestackClientListAppIDsOptions struct { + AppIDVersion *string + AppPrefix *string + Skip *string + Top *int32 +} + +// GlobalRulestackClientListCountriesOptions contains the optional parameters for the GlobalRulestackClient.ListCountries +// method. +type GlobalRulestackClientListCountriesOptions struct { + Skip *string + Top *int32 +} + +// GlobalRulestackClientListFirewallsOptions contains the optional parameters for the GlobalRulestackClient.ListFirewalls +// method. +type GlobalRulestackClientListFirewallsOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackClientListOptions contains the optional parameters for the GlobalRulestackClient.NewListPager method. +type GlobalRulestackClientListOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackClientListPredefinedURLCategoriesOptions contains the optional parameters for the GlobalRulestackClient.ListPredefinedURLCategories +// method. +type GlobalRulestackClientListPredefinedURLCategoriesOptions struct { + Skip *string + Top *int32 +} + +// GlobalRulestackClientListSecurityServicesOptions contains the optional parameters for the GlobalRulestackClient.ListSecurityServices +// method. +type GlobalRulestackClientListSecurityServicesOptions struct { + Skip *string + Top *int32 +} + +// GlobalRulestackClientRevertOptions contains the optional parameters for the GlobalRulestackClient.Revert method. +type GlobalRulestackClientRevertOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackClientUpdateOptions contains the optional parameters for the GlobalRulestackClient.Update method. +type GlobalRulestackClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GlobalRulestackInfo - PAN Rulestack Describe Object +type GlobalRulestackInfo struct { + // REQUIRED; rulestack description + AzureID *string +} + +// GlobalRulestackResource - PaloAltoNetworks GlobalRulestack +type GlobalRulestackResource struct { + // REQUIRED; Global Location + Location *string + + // REQUIRED; The resource-specific properties for this resource. + Properties *RulestackProperties + + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GlobalRulestackResourceListResult - The response of a GlobalRulestackResource list operation. +type GlobalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*GlobalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// GlobalRulestackResourceUpdate - The type used for update operations of the GlobalRulestackResource. +type GlobalRulestackResourceUpdate struct { + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // Global Location + Location *string + + // The updatable properties of the GlobalRulestackResource. + Properties *GlobalRulestackResourceUpdateProperties +} + +// GlobalRulestackResourceUpdateProperties - The updatable properties of the GlobalRulestackResource. +type GlobalRulestackResourceUpdateProperties struct { + // subscription scope of global rulestack + AssociatedSubscriptions []*string + + // Mode for default rules creation + DefaultMode *DefaultMode + + // rulestack description + Description *string + + // minimum version + MinAppIDVersion *string + + // PanEtag info + PanEtag *string + + // Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks + PanLocation *string + + // Rulestack Type + Scope *ScopeType + + // Security Profile + SecurityServices *SecurityServices +} + +// IPAddress - IP Address +type IPAddress struct { + // Address value + Address *string + + // Resource Id + ResourceID *string +} + +// IPAddressSpace - IP Address Space +type IPAddressSpace struct { + // Address Space + AddressSpace *string + + // Resource Id + ResourceID *string +} + +type ListAppIDResponse struct { + // REQUIRED; List of AppIds + Value []*string + + // next Link + NextLink *string +} + +// ListFirewallsResponse - List firewalls response +type ListFirewallsResponse struct { + // REQUIRED; firewalls list + Value []*string + + // next link + NextLink *string +} + +// LocalRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalRulesClient.BeginCreateOrUpdate +// method. +type LocalRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalRulesClientBeginDeleteOptions contains the optional parameters for the LocalRulesClient.BeginDelete method. +type LocalRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalRulesClientGetCountersOptions contains the optional parameters for the LocalRulesClient.GetCounters method. +type LocalRulesClientGetCountersOptions struct { + FirewallName *string +} + +// LocalRulesClientGetOptions contains the optional parameters for the LocalRulesClient.Get method. +type LocalRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LocalRulesClientListByLocalRulestacksOptions contains the optional parameters for the LocalRulesClient.NewListByLocalRulestacksPager +// method. +type LocalRulesClientListByLocalRulestacksOptions struct { + // placeholder for future optional parameters +} + +// LocalRulesClientRefreshCountersOptions contains the optional parameters for the LocalRulesClient.RefreshCounters method. +type LocalRulesClientRefreshCountersOptions struct { + FirewallName *string +} + +// LocalRulesClientResetCountersOptions contains the optional parameters for the LocalRulesClient.ResetCounters method. +type LocalRulesClientResetCountersOptions struct { + FirewallName *string +} + +// LocalRulesResource - LocalRulestack rule list +type LocalRulesResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *RuleEntry + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LocalRulesResourceListResult - The response of a LocalRulesResource list operation. +type LocalRulesResourceListResult struct { + // REQUIRED; The items on this page + Value []*LocalRulesResource + + // The link to the next page of items + NextLink *string +} + +// LocalRulestackResource - PaloAltoNetworks LocalRulestack +type LocalRulestackResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; The resource-specific properties for this resource. + Properties *RulestackProperties + + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LocalRulestackResourceListResult - The response of a LocalRulestackResource list operation. +type LocalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*LocalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// LocalRulestackResourceUpdate - The type used for update operations of the LocalRulestackResource. +type LocalRulestackResourceUpdate struct { + // The managed service identities assigned to this resource. + Identity *AzureResourceManagerManagedIdentityProperties + + // The updatable properties of the LocalRulestackResource. + Properties *LocalRulestackResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// LocalRulestackResourceUpdateProperties - The updatable properties of the LocalRulestackResource. +type LocalRulestackResourceUpdateProperties struct { + // subscription scope of global rulestack + AssociatedSubscriptions []*string + + // Mode for default rules creation + DefaultMode *DefaultMode + + // rulestack description + Description *string + + // minimum version + MinAppIDVersion *string + + // PanEtag info + PanEtag *string + + // Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks + PanLocation *string + + // Rulestack Type + Scope *ScopeType + + // Security Profile + SecurityServices *SecurityServices +} + +// LocalRulestacksClientBeginCommitOptions contains the optional parameters for the LocalRulestacksClient.BeginCommit method. +type LocalRulestacksClientBeginCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalRulestacksClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalRulestacksClient.BeginCreateOrUpdate +// method. +type LocalRulestacksClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalRulestacksClientBeginDeleteOptions contains the optional parameters for the LocalRulestacksClient.BeginDelete method. +type LocalRulestacksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LocalRulestacksClientGetChangeLogOptions contains the optional parameters for the LocalRulestacksClient.GetChangeLog method. +type LocalRulestacksClientGetChangeLogOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientGetOptions contains the optional parameters for the LocalRulestacksClient.Get method. +type LocalRulestacksClientGetOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientGetSupportInfoOptions contains the optional parameters for the LocalRulestacksClient.GetSupportInfo +// method. +type LocalRulestacksClientGetSupportInfoOptions struct { + // email address on behalf of which this API called + Email *string +} + +// LocalRulestacksClientListAdvancedSecurityObjectsOptions contains the optional parameters for the LocalRulestacksClient.ListAdvancedSecurityObjects +// method. +type LocalRulestacksClientListAdvancedSecurityObjectsOptions struct { + Skip *string + Top *int32 +} + +// LocalRulestacksClientListAppIDsOptions contains the optional parameters for the LocalRulestacksClient.ListAppIDs method. +type LocalRulestacksClientListAppIDsOptions struct { + AppIDVersion *string + AppPrefix *string + Skip *string + Top *int32 +} + +// LocalRulestacksClientListByResourceGroupOptions contains the optional parameters for the LocalRulestacksClient.NewListByResourceGroupPager +// method. +type LocalRulestacksClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientListBySubscriptionOptions contains the optional parameters for the LocalRulestacksClient.NewListBySubscriptionPager +// method. +type LocalRulestacksClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientListCountriesOptions contains the optional parameters for the LocalRulestacksClient.ListCountries +// method. +type LocalRulestacksClientListCountriesOptions struct { + Skip *string + Top *int32 +} + +// LocalRulestacksClientListFirewallsOptions contains the optional parameters for the LocalRulestacksClient.ListFirewalls +// method. +type LocalRulestacksClientListFirewallsOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientListPredefinedURLCategoriesOptions contains the optional parameters for the LocalRulestacksClient.ListPredefinedURLCategories +// method. +type LocalRulestacksClientListPredefinedURLCategoriesOptions struct { + Skip *string + Top *int32 +} + +// LocalRulestacksClientListSecurityServicesOptions contains the optional parameters for the LocalRulestacksClient.ListSecurityServices +// method. +type LocalRulestacksClientListSecurityServicesOptions struct { + Skip *string + Top *int32 +} + +// LocalRulestacksClientRevertOptions contains the optional parameters for the LocalRulestacksClient.Revert method. +type LocalRulestacksClientRevertOptions struct { + // placeholder for future optional parameters +} + +// LocalRulestacksClientUpdateOptions contains the optional parameters for the LocalRulestacksClient.Update method. +type LocalRulestacksClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// LogDestination - Log Destination +type LogDestination struct { + // Event Hub configurations + EventHubConfigurations *EventHub + + // Monitor Log configurations + MonitorConfigurations *MonitorLog + + // Storage account configurations + StorageConfigurations *StorageAccount +} + +// LogSettings - Log Settings for Firewall +type LogSettings struct { + // Application Insight details + ApplicationInsights *ApplicationInsights + + // Common destination configurations + CommonDestination *LogDestination + + // Decrypt destination configurations + DecryptLogDestination *LogDestination + + // Log option SAME/INDIVIDUAL + LogOption *LogOption + + // One of possible log type + LogType *LogType + + // Threat destination configurations + ThreatLogDestination *LogDestination + + // Traffic destination configurations + TrafficLogDestination *LogDestination +} + +// MarketplaceDetails of PAN Firewall resource +type MarketplaceDetails struct { + // REQUIRED; Offer Id + OfferID *string + + // REQUIRED; Publisher Id + PublisherID *string + + // Marketplace Subscription Status + MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus + + // READ-ONLY; Marketplace Subscription Id + MarketplaceSubscriptionID *string +} + +// MonitorLog configurations +type MonitorLog struct { + // Resource ID of MonitorLog + ID *string + + // Primary Key value for Monitor + PrimaryKey *string + + // Secondary Key value for Monitor + SecondaryKey *string + + // Subscription Id + SubscriptionID *string + + // MonitorLog workspace + Workspace *string +} + +// NameDescriptionObject - object type info +type NameDescriptionObject struct { + // REQUIRED; name value + Name *string + + // description value + Description *string +} + +// NetworkProfile - Network settings for Firewall +type NetworkProfile struct { + // REQUIRED; Enable egress NAT, enabled by default + EnableEgressNat *EgressNat + + // REQUIRED; vnet or vwan, cannot be updated + NetworkType *NetworkType + + // REQUIRED; List of IPs associated with the Firewall + PublicIPs []*IPAddress + + // Egress nat IP to use + EgressNatIP []*IPAddress + + // Vnet configurations + VnetConfiguration *VnetConfiguration + + // Vwan configurations + VwanConfiguration *VwanConfiguration +} + +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PanoramaConfig - Panorama Config +type PanoramaConfig struct { + // REQUIRED; Base64 encoded string representing Panorama parameters to be used by Firewall to connect to Panorama. This string + // is generated via azure plugin in Panorama + ConfigString *string + + // READ-ONLY; Panorama Collector Group to join - (Once configured we can not edit the value) + CgName *string + + // READ-ONLY; Panorama Device Group to join + DgName *string + + // READ-ONLY; Resource name(may be unique) for PN admin + HostName *string + + // READ-ONLY; Primary Panorama Server IP address value in dotted format for IPv4 + PanoramaServer *string + + // READ-ONLY; Secondary Panorama Server IP address value in dotted format for IPv4 + PanoramaServer2 *string + + // READ-ONLY; Panorama Template Stack to join - (Once configured we can not edit the value) + TplName *string + + // READ-ONLY; VM auth key for panorama connectivity + VMAuthKey *string +} + +// PanoramaStatus - Panorama connectivity information +type PanoramaStatus struct { + // READ-ONLY; Secondary Panorama connection status + PanoramaServer2Status *ServerStatus + + // READ-ONLY; Primary Panorama connection status + PanoramaServerStatus *ServerStatus +} + +// PlanData - Billing plan information. +type PlanData struct { + // REQUIRED; different billing cycles like MONTHLY/WEEKLY + BillingCycle *BillingCycle + + // REQUIRED; plan id as published by Liftr.PAN + PlanID *string + + // different usage type like PAYG/COMMITTED + UsageType *UsageType + + // READ-ONLY; date when plan was applied + EffectiveDate *time.Time +} + +// PostRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the PostRulesClient.BeginCreateOrUpdate +// method. +type PostRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PostRulesClientBeginDeleteOptions contains the optional parameters for the PostRulesClient.BeginDelete method. +type PostRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PostRulesClientGetCountersOptions contains the optional parameters for the PostRulesClient.GetCounters method. +type PostRulesClientGetCountersOptions struct { + FirewallName *string +} + +// PostRulesClientGetOptions contains the optional parameters for the PostRulesClient.Get method. +type PostRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PostRulesClientListOptions contains the optional parameters for the PostRulesClient.NewListPager method. +type PostRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// PostRulesClientRefreshCountersOptions contains the optional parameters for the PostRulesClient.RefreshCounters method. +type PostRulesClientRefreshCountersOptions struct { + FirewallName *string +} + +// PostRulesClientResetCountersOptions contains the optional parameters for the PostRulesClient.ResetCounters method. +type PostRulesClientResetCountersOptions struct { + FirewallName *string +} + +// PostRulesResource - PostRulestack rule list +type PostRulesResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *RuleEntry + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PostRulesResourceListResult - The response of a PostRulesResource list operation. +type PostRulesResourceListResult struct { + // REQUIRED; The items on this page + Value []*PostRulesResource + + // The link to the next page of items + NextLink *string +} + +// PreRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the PreRulesClient.BeginCreateOrUpdate method. +type PreRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PreRulesClientBeginDeleteOptions contains the optional parameters for the PreRulesClient.BeginDelete method. +type PreRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PreRulesClientGetCountersOptions contains the optional parameters for the PreRulesClient.GetCounters method. +type PreRulesClientGetCountersOptions struct { + FirewallName *string +} + +// PreRulesClientGetOptions contains the optional parameters for the PreRulesClient.Get method. +type PreRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PreRulesClientListOptions contains the optional parameters for the PreRulesClient.NewListPager method. +type PreRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// PreRulesClientRefreshCountersOptions contains the optional parameters for the PreRulesClient.RefreshCounters method. +type PreRulesClientRefreshCountersOptions struct { + FirewallName *string +} + +// PreRulesClientResetCountersOptions contains the optional parameters for the PreRulesClient.ResetCounters method. +type PreRulesClientResetCountersOptions struct { + FirewallName *string +} + +// PreRulesResource - PreRulestack rule list +type PreRulesResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *RuleEntry + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PreRulesResourceListResult - The response of a PreRulesResource list operation. +type PreRulesResourceListResult struct { + // REQUIRED; The items on this page + Value []*PreRulesResource + + // The link to the next page of items + NextLink *string +} + +// PredefinedURLCategoriesResponse - predefined url categories response +type PredefinedURLCategoriesResponse struct { + // REQUIRED; predefined url categories + Value []*PredefinedURLCategory + + // next link + NextLink *string +} + +// PredefinedURLCategory - Predefined URL category object +type PredefinedURLCategory struct { + // REQUIRED + Action *string + + // REQUIRED + Name *string +} + +// PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the PrefixListGlobalRulestackClient.BeginCreateOrUpdate +// method. +type PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrefixListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the PrefixListGlobalRulestackClient.BeginDelete +// method. +type PrefixListGlobalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrefixListGlobalRulestackClientGetOptions contains the optional parameters for the PrefixListGlobalRulestackClient.Get +// method. +type PrefixListGlobalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrefixListGlobalRulestackClientListOptions contains the optional parameters for the PrefixListGlobalRulestackClient.NewListPager +// method. +type PrefixListGlobalRulestackClientListOptions struct { + // placeholder for future optional parameters +} + +// PrefixListGlobalRulestackResource - GlobalRulestack prefixList +type PrefixListGlobalRulestackResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *PrefixObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PrefixListGlobalRulestackResourceListResult - The response of a PrefixListGlobalRulestackResource list operation. +type PrefixListGlobalRulestackResourceListResult struct { + // REQUIRED; The items on this page + Value []*PrefixListGlobalRulestackResource + + // The link to the next page of items + NextLink *string +} + +// PrefixListLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the PrefixListLocalRulestackClient.BeginCreateOrUpdate +// method. +type PrefixListLocalRulestackClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrefixListLocalRulestackClientBeginDeleteOptions contains the optional parameters for the PrefixListLocalRulestackClient.BeginDelete +// method. +type PrefixListLocalRulestackClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrefixListLocalRulestackClientGetOptions contains the optional parameters for the PrefixListLocalRulestackClient.Get method. +type PrefixListLocalRulestackClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrefixListLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the PrefixListLocalRulestackClient.NewListByLocalRulestacksPager +// method. +type PrefixListLocalRulestackClientListByLocalRulestacksOptions struct { + // placeholder for future optional parameters +} + +// PrefixListResource - LocalRulestack prefixList +type PrefixListResource struct { + // REQUIRED; The resource-specific properties for this resource. + Properties *PrefixObject + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PrefixListResourceListResult - The response of a PrefixListResource list operation. +type PrefixListResourceListResult struct { + // REQUIRED; The items on this page + Value []*PrefixListResource + + // The link to the next page of items + NextLink *string +} + +// PrefixObject - prefix entry +type PrefixObject struct { + // REQUIRED; prefix list + PrefixList []*string + + // comment for this object + AuditComment *string + + // prefix description + Description *string + + // etag info + Etag *string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// RuleCounter - Rule counter +type RuleCounter struct { + // REQUIRED; priority number + Priority *string + + // REQUIRED; rule name + RuleName *string + + // apps seen + AppSeen *AppSeenData + + // firewall name + FirewallName *string + + // hit count + HitCount *int32 + + // last updated timestamp + LastUpdatedTimestamp *time.Time + + // timestamp of request + RequestTimestamp *time.Time + + // rule list name + RuleListName *string + + // rule Stack Name + RuleStackName *string + + // timestamp of response + Timestamp *time.Time +} + +// RuleCounterReset - Rule counter reset +type RuleCounterReset struct { + // firewall name + FirewallName *string + + // rule list name + RuleListName *string + + // rule name + RuleName *string + + // rule Stack Name + RuleStackName *string + + // READ-ONLY; priority number + Priority *string +} + +// RuleEntry - definition of rule +type RuleEntry struct { + // REQUIRED; rule name + RuleName *string + + // rule action + ActionType *ActionEnum + + // array of rule applications + Applications []*string + + // rule comment + AuditComment *string + + // rule category + Category *Category + + // enable or disable decryption + DecryptionRuleType *DecryptionRuleTypeEnum + + // rule description + Description *string + + // destination address + Destination *DestinationAddr + + // enable or disable logging + EnableLogging *StateEnum + + // etag info + Etag *string + + // inbound Inspection Certificate + InboundInspectionCertificate *string + + // cidr should not be 'any' + NegateDestination *BooleanEnum + + // cidr should not be 'any' + NegateSource *BooleanEnum + + // any, application-default, TCP:number, UDP:number + Protocol *string + + // prot port list + ProtocolPortList []*string + + // state of this rule + RuleState *StateEnum + + // source address + Source *SourceAddr + + // tag for rule + Tags []*TagInfo + + // READ-ONLY + Priority *int32 + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// RulestackDetails - Associated rulestack details +type RulestackDetails struct { + // Rulestack location + Location *string + + // Resource Id + ResourceID *string + + // Associated rulestack Id + RulestackID *string +} + +// RulestackProperties - PAN Rulestack Describe Object +type RulestackProperties struct { + // subscription scope of global rulestack + AssociatedSubscriptions []*string + + // Mode for default rules creation + DefaultMode *DefaultMode + + // rulestack description + Description *string + + // minimum version + MinAppIDVersion *string + + // PanEtag info + PanEtag *string + + // Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks + PanLocation *string + + // Rulestack Type + Scope *ScopeType + + // Security Profile + SecurityServices *SecurityServices + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// SecurityServices - security services +type SecurityServices struct { + // Anti spyware Profile data + AntiSpywareProfile *string + + // anti virus profile data + AntiVirusProfile *string + + // DNS Subscription profile data + DNSSubscription *string + + // File blocking profile data + FileBlockingProfile *string + + // Trusted Egress Decryption profile data + OutboundTrustCertificate *string + + // Untrusted Egress Decryption profile data + OutboundUnTrustCertificate *string + + // URL filtering profile data + URLFilteringProfile *string + + // IPs Vulnerability Profile Data + VulnerabilityProfile *string +} + +// SecurityServicesResponse - Security services list response +type SecurityServicesResponse struct { + // REQUIRED; response value + Value *SecurityServicesTypeList + + // next link + NextLink *string +} + +// SecurityServicesTypeList - Security services type list +type SecurityServicesTypeList struct { + // REQUIRED; list + Entry []*NameDescriptionObject + + // security services type + Type *string +} + +// SourceAddr - Address properties +type SourceAddr struct { + // special value 'any' + Cidrs []*string + + // list of countries + Countries []*string + + // list of feeds + Feeds []*string + + // prefix list + PrefixLists []*string +} + +// StorageAccount - Storage Account configurations +type StorageAccount struct { + // Storage account name + AccountName *string + + // Resource ID of storage account + ID *string + + // Subscription Id + SubscriptionID *string +} + +// SupportInfo - Support information for the resource +type SupportInfo struct { + // Support account associated with given resource + AccountID *string + + // account registered in Customer Support Portal + AccountRegistered *BooleanEnum + + // Product usage is in free trial period + FreeTrial *BooleanEnum + + // Free trial credit remaining + FreeTrialCreditLeft *int32 + + // Free trial days remaining + FreeTrialDaysLeft *int32 + + // URL for paloaltonetworks live community + HelpURL *string + + // product SKU associated with given resource + ProductSKU *string + + // product Serial associated with given resource + ProductSerial *string + + // URL for registering product in paloaltonetworks Customer Service Portal + RegisterURL *string + + // URL for paloaltonetworks Customer Service Portal + SupportURL *string + + // user domain is supported in Customer Support Portal + UserDomainSupported *BooleanEnum + + // user registered in Customer Support Portal + UserRegistered *BooleanEnum +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + +// TagInfo - Tag +type TagInfo struct { + // REQUIRED; tag name + Key *string + + // REQUIRED; tag value + Value *string +} + +// VnetConfiguration - VnetInfo for Firewall Networking +type VnetConfiguration struct { + // REQUIRED; Trust Subnet + TrustSubnet *IPAddressSpace + + // REQUIRED; Untrust Subnet + UnTrustSubnet *IPAddressSpace + + // REQUIRED; Azure Virtual Network + Vnet *IPAddressSpace + + // IP of trust subnet for UDR + IPOfTrustSubnetForUdr *IPAddress +} + +// VwanConfiguration - VwanInfo for Firewall Networking +type VwanConfiguration struct { + // REQUIRED; vHub Address + VHub *IPAddressSpace + + // IP of trust subnet for UDR + IPOfTrustSubnetForUdr *IPAddress + + // Network Virtual Appliance resource ID + NetworkVirtualApplianceID *string + + // Trust Subnet + TrustSubnet *IPAddressSpace + + // Untrust Subnet + UnTrustSubnet *IPAddressSpace +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go new file mode 100644 index 00000000..578fddec --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go @@ -0,0 +1,3530 @@ +//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 armpanngfw + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AdvSecurityObjectListResponse. +func (a AdvSecurityObjectListResponse) 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 AdvSecurityObjectListResponse. +func (a *AdvSecurityObjectListResponse) UnmarshalJSON(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 AdvSecurityObjectModel. +func (a AdvSecurityObjectModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "entry", a.Entry) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvSecurityObjectModel. +func (a *AdvSecurityObjectModel) UnmarshalJSON(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 "entry": + err = unpopulate(val, "Entry", &a.Entry) + 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 AppSeenData. +func (a AppSeenData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appSeenList", a.AppSeenList) + populate(objectMap, "count", a.Count) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppSeenData. +func (a *AppSeenData) UnmarshalJSON(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 "appSeenList": + err = unpopulate(val, "AppSeenList", &a.AppSeenList) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &a.Count) + 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 AppSeenInfo. +func (a AppSeenInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", a.Category) + populate(objectMap, "risk", a.Risk) + populate(objectMap, "standardPorts", a.StandardPorts) + populate(objectMap, "subCategory", a.SubCategory) + populate(objectMap, "tag", a.Tag) + populate(objectMap, "technology", a.Technology) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppSeenInfo. +func (a *AppSeenInfo) UnmarshalJSON(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 "category": + err = unpopulate(val, "Category", &a.Category) + delete(rawMsg, key) + case "risk": + err = unpopulate(val, "Risk", &a.Risk) + delete(rawMsg, key) + case "standardPorts": + err = unpopulate(val, "StandardPorts", &a.StandardPorts) + delete(rawMsg, key) + case "subCategory": + err = unpopulate(val, "SubCategory", &a.SubCategory) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &a.Tag) + delete(rawMsg, key) + case "technology": + err = unpopulate(val, "Technology", &a.Technology) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + 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 ApplicationInsights. +func (a ApplicationInsights) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "key", a.Key) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationInsights. +func (a *ApplicationInsights) UnmarshalJSON(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 "key": + err = unpopulate(val, "Key", &a.Key) + 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 AzureResourceManagerManagedIdentityProperties. +func (a AzureResourceManagerManagedIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", a.PrincipalID) + populate(objectMap, "tenantId", a.TenantID) + populate(objectMap, "type", a.Type) + populate(objectMap, "userAssignedIdentities", a.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceManagerManagedIdentityProperties. +func (a *AzureResourceManagerManagedIdentityProperties) UnmarshalJSON(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 "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &a.UserAssignedIdentities) + 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 AzureResourceManagerUserAssignedIdentity. +func (a AzureResourceManagerUserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", a.ClientID) + populate(objectMap, "principalId", a.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceManagerUserAssignedIdentity. +func (a *AzureResourceManagerUserAssignedIdentity) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &a.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + 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 Category. +func (c Category) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "feeds", c.Feeds) + populate(objectMap, "urlCustom", c.URLCustom) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Category. +func (c *Category) UnmarshalJSON(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 "feeds": + err = unpopulate(val, "Feeds", &c.Feeds) + delete(rawMsg, key) + case "urlCustom": + err = unpopulate(val, "URLCustom", &c.URLCustom) + 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 CertificateObject. +func (c CertificateObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditComment", c.AuditComment) + populate(objectMap, "certificateSelfSigned", c.CertificateSelfSigned) + populate(objectMap, "certificateSignerResourceId", c.CertificateSignerResourceID) + populate(objectMap, "description", c.Description) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateObject. +func (c *CertificateObject) UnmarshalJSON(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 "auditComment": + err = unpopulate(val, "AuditComment", &c.AuditComment) + delete(rawMsg, key) + case "certificateSelfSigned": + err = unpopulate(val, "CertificateSelfSigned", &c.CertificateSelfSigned) + delete(rawMsg, key) + case "certificateSignerResourceId": + err = unpopulate(val, "CertificateSignerResourceID", &c.CertificateSignerResourceID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + 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 CertificateObjectGlobalRulestackResource. +func (c CertificateObjectGlobalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 CertificateObjectGlobalRulestackResource. +func (c *CertificateObjectGlobalRulestackResource) UnmarshalJSON(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 "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 CertificateObjectGlobalRulestackResourceListResult. +func (c CertificateObjectGlobalRulestackResourceListResult) 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 CertificateObjectGlobalRulestackResourceListResult. +func (c *CertificateObjectGlobalRulestackResourceListResult) UnmarshalJSON(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 CertificateObjectLocalRulestackResource. +func (c CertificateObjectLocalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 CertificateObjectLocalRulestackResource. +func (c *CertificateObjectLocalRulestackResource) UnmarshalJSON(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 "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 CertificateObjectLocalRulestackResourceListResult. +func (c CertificateObjectLocalRulestackResourceListResult) 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 CertificateObjectLocalRulestackResourceListResult. +func (c *CertificateObjectLocalRulestackResourceListResult) UnmarshalJSON(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 Changelog. +func (c Changelog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "changes", c.Changes) + populateTimeRFC3339(objectMap, "lastCommitted", c.LastCommitted) + populateTimeRFC3339(objectMap, "lastModified", c.LastModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Changelog. +func (c *Changelog) UnmarshalJSON(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 "changes": + err = unpopulate(val, "Changes", &c.Changes) + delete(rawMsg, key) + case "lastCommitted": + err = unpopulateTimeRFC3339(val, "LastCommitted", &c.LastCommitted) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &c.LastModified) + 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 CountriesResponse. +func (c CountriesResponse) 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 CountriesResponse. +func (c *CountriesResponse) UnmarshalJSON(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 Country. +func (c Country) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", c.Code) + populate(objectMap, "description", c.Description) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Country. +func (c *Country) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + 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 DNSSettings. +func (d DNSSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsServers", d.DNSServers) + populate(objectMap, "enableDnsProxy", d.EnableDNSProxy) + populate(objectMap, "enabledDnsType", d.EnabledDNSType) + 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 "dnsServers": + err = unpopulate(val, "DNSServers", &d.DNSServers) + delete(rawMsg, key) + case "enableDnsProxy": + err = unpopulate(val, "EnableDNSProxy", &d.EnableDNSProxy) + delete(rawMsg, key) + case "enabledDnsType": + err = unpopulate(val, "EnabledDNSType", &d.EnabledDNSType) + 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 DestinationAddr. +func (d DestinationAddr) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cidrs", d.Cidrs) + populate(objectMap, "countries", d.Countries) + populate(objectMap, "feeds", d.Feeds) + populate(objectMap, "fqdnLists", d.FqdnLists) + populate(objectMap, "prefixLists", d.PrefixLists) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationAddr. +func (d *DestinationAddr) UnmarshalJSON(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 "cidrs": + err = unpopulate(val, "Cidrs", &d.Cidrs) + delete(rawMsg, key) + case "countries": + err = unpopulate(val, "Countries", &d.Countries) + delete(rawMsg, key) + case "feeds": + err = unpopulate(val, "Feeds", &d.Feeds) + delete(rawMsg, key) + case "fqdnLists": + err = unpopulate(val, "FqdnLists", &d.FqdnLists) + delete(rawMsg, key) + case "prefixLists": + err = unpopulate(val, "PrefixLists", &d.PrefixLists) + 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 EndpointConfiguration. +func (e EndpointConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", e.Address) + populate(objectMap, "port", e.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointConfiguration. +func (e *EndpointConfiguration) UnmarshalJSON(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 "port": + err = unpopulate(val, "Port", &e.Port) + 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 EventHub. +func (e EventHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "nameSpace", e.NameSpace) + populate(objectMap, "policyName", e.PolicyName) + populate(objectMap, "subscriptionId", e.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHub. +func (e *EventHub) UnmarshalJSON(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 "nameSpace": + err = unpopulate(val, "NameSpace", &e.NameSpace) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &e.PolicyName) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &e.SubscriptionID) + 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 FirewallDeploymentProperties. +func (f FirewallDeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedRulestack", f.AssociatedRulestack) + populate(objectMap, "dnsSettings", f.DNSSettings) + populate(objectMap, "frontEndSettings", f.FrontEndSettings) + populate(objectMap, "isPanoramaManaged", f.IsPanoramaManaged) + populate(objectMap, "marketplaceDetails", f.MarketplaceDetails) + populate(objectMap, "networkProfile", f.NetworkProfile) + populate(objectMap, "panEtag", f.PanEtag) + populate(objectMap, "panoramaConfig", f.PanoramaConfig) + populate(objectMap, "planData", f.PlanData) + populate(objectMap, "provisioningState", f.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallDeploymentProperties. +func (f *FirewallDeploymentProperties) UnmarshalJSON(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 "associatedRulestack": + err = unpopulate(val, "AssociatedRulestack", &f.AssociatedRulestack) + delete(rawMsg, key) + case "dnsSettings": + err = unpopulate(val, "DNSSettings", &f.DNSSettings) + delete(rawMsg, key) + case "frontEndSettings": + err = unpopulate(val, "FrontEndSettings", &f.FrontEndSettings) + delete(rawMsg, key) + case "isPanoramaManaged": + err = unpopulate(val, "IsPanoramaManaged", &f.IsPanoramaManaged) + delete(rawMsg, key) + case "marketplaceDetails": + err = unpopulate(val, "MarketplaceDetails", &f.MarketplaceDetails) + delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &f.NetworkProfile) + delete(rawMsg, key) + case "panEtag": + err = unpopulate(val, "PanEtag", &f.PanEtag) + delete(rawMsg, key) + case "panoramaConfig": + err = unpopulate(val, "PanoramaConfig", &f.PanoramaConfig) + delete(rawMsg, key) + case "planData": + err = unpopulate(val, "PlanData", &f.PlanData) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + 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 FirewallResource. +func (f FirewallResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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, "systemData", f.SystemData) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallResource. +func (f *FirewallResource) UnmarshalJSON(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 "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 "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + 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 FirewallResourceListResult. +func (f FirewallResourceListResult) 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 FirewallResourceListResult. +func (f *FirewallResourceListResult) UnmarshalJSON(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 FirewallResourceUpdate. +func (f FirewallResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", f.Identity) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallResourceUpdate. +func (f *FirewallResourceUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &f.Identity) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallResourceUpdateProperties. +func (f FirewallResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedRulestack", f.AssociatedRulestack) + populate(objectMap, "dnsSettings", f.DNSSettings) + populate(objectMap, "frontEndSettings", f.FrontEndSettings) + populate(objectMap, "isPanoramaManaged", f.IsPanoramaManaged) + populate(objectMap, "marketplaceDetails", f.MarketplaceDetails) + populate(objectMap, "networkProfile", f.NetworkProfile) + populate(objectMap, "panEtag", f.PanEtag) + populate(objectMap, "panoramaConfig", f.PanoramaConfig) + populate(objectMap, "planData", f.PlanData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallResourceUpdateProperties. +func (f *FirewallResourceUpdateProperties) UnmarshalJSON(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 "associatedRulestack": + err = unpopulate(val, "AssociatedRulestack", &f.AssociatedRulestack) + delete(rawMsg, key) + case "dnsSettings": + err = unpopulate(val, "DNSSettings", &f.DNSSettings) + delete(rawMsg, key) + case "frontEndSettings": + err = unpopulate(val, "FrontEndSettings", &f.FrontEndSettings) + delete(rawMsg, key) + case "isPanoramaManaged": + err = unpopulate(val, "IsPanoramaManaged", &f.IsPanoramaManaged) + delete(rawMsg, key) + case "marketplaceDetails": + err = unpopulate(val, "MarketplaceDetails", &f.MarketplaceDetails) + delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &f.NetworkProfile) + delete(rawMsg, key) + case "panEtag": + err = unpopulate(val, "PanEtag", &f.PanEtag) + delete(rawMsg, key) + case "panoramaConfig": + err = unpopulate(val, "PanoramaConfig", &f.PanoramaConfig) + delete(rawMsg, key) + case "planData": + err = unpopulate(val, "PlanData", &f.PlanData) + 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 FirewallStatusProperty. +func (f FirewallStatusProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "healthReason", f.HealthReason) + populate(objectMap, "healthStatus", f.HealthStatus) + populate(objectMap, "isPanoramaManaged", f.IsPanoramaManaged) + populate(objectMap, "panoramaStatus", f.PanoramaStatus) + populate(objectMap, "provisioningState", f.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallStatusProperty. +func (f *FirewallStatusProperty) UnmarshalJSON(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 "healthReason": + err = unpopulate(val, "HealthReason", &f.HealthReason) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &f.HealthStatus) + delete(rawMsg, key) + case "isPanoramaManaged": + err = unpopulate(val, "IsPanoramaManaged", &f.IsPanoramaManaged) + delete(rawMsg, key) + case "panoramaStatus": + err = unpopulate(val, "PanoramaStatus", &f.PanoramaStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + 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 FirewallStatusResource. +func (f FirewallStatusResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallStatusResource. +func (f *FirewallStatusResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + 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 FirewallStatusResourceListResult. +func (f FirewallStatusResourceListResult) 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 FirewallStatusResourceListResult. +func (f *FirewallStatusResourceListResult) UnmarshalJSON(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 FqdnListGlobalRulestackResource. +func (f FqdnListGlobalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FqdnListGlobalRulestackResource. +func (f *FqdnListGlobalRulestackResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + 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 FqdnListGlobalRulestackResourceListResult. +func (f FqdnListGlobalRulestackResourceListResult) 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 FqdnListGlobalRulestackResourceListResult. +func (f *FqdnListGlobalRulestackResourceListResult) UnmarshalJSON(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 FqdnListLocalRulestackResource. +func (f FqdnListLocalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FqdnListLocalRulestackResource. +func (f *FqdnListLocalRulestackResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + 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 FqdnListLocalRulestackResourceListResult. +func (f FqdnListLocalRulestackResourceListResult) 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 FqdnListLocalRulestackResourceListResult. +func (f *FqdnListLocalRulestackResourceListResult) UnmarshalJSON(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 FqdnObject. +func (f FqdnObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditComment", f.AuditComment) + populate(objectMap, "description", f.Description) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "fqdnList", f.FqdnList) + populate(objectMap, "provisioningState", f.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FqdnObject. +func (f *FqdnObject) UnmarshalJSON(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 "auditComment": + err = unpopulate(val, "AuditComment", &f.AuditComment) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "fqdnList": + err = unpopulate(val, "FqdnList", &f.FqdnList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + 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 FrontendSetting. +func (f FrontendSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendConfiguration", f.BackendConfiguration) + populate(objectMap, "frontendConfiguration", f.FrontendConfiguration) + populate(objectMap, "name", f.Name) + populate(objectMap, "protocol", f.Protocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FrontendSetting. +func (f *FrontendSetting) UnmarshalJSON(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 "backendConfiguration": + err = unpopulate(val, "BackendConfiguration", &f.BackendConfiguration) + delete(rawMsg, key) + case "frontendConfiguration": + err = unpopulate(val, "FrontendConfiguration", &f.FrontendConfiguration) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalRulestackInfo. +func (g GlobalRulestackInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureId", g.AzureID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalRulestackInfo. +func (g *GlobalRulestackInfo) UnmarshalJSON(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 "azureId": + err = unpopulate(val, "AzureID", &g.AzureID) + 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 GlobalRulestackResource. +func (g GlobalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) + populate(objectMap, "location", g.Location) + 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 GlobalRulestackResource. +func (g *GlobalRulestackResource) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &g.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + 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 GlobalRulestackResourceListResult. +func (g GlobalRulestackResourceListResult) 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 GlobalRulestackResourceListResult. +func (g *GlobalRulestackResourceListResult) UnmarshalJSON(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 GlobalRulestackResourceUpdate. +func (g GlobalRulestackResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", g.Identity) + populate(objectMap, "location", g.Location) + populate(objectMap, "properties", g.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalRulestackResourceUpdate. +func (g *GlobalRulestackResourceUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &g.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + 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 GlobalRulestackResourceUpdateProperties. +func (g GlobalRulestackResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedSubscriptions", g.AssociatedSubscriptions) + populate(objectMap, "defaultMode", g.DefaultMode) + populate(objectMap, "description", g.Description) + populate(objectMap, "minAppIdVersion", g.MinAppIDVersion) + populate(objectMap, "panEtag", g.PanEtag) + populate(objectMap, "panLocation", g.PanLocation) + populate(objectMap, "scope", g.Scope) + populate(objectMap, "securityServices", g.SecurityServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalRulestackResourceUpdateProperties. +func (g *GlobalRulestackResourceUpdateProperties) UnmarshalJSON(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 "associatedSubscriptions": + err = unpopulate(val, "AssociatedSubscriptions", &g.AssociatedSubscriptions) + delete(rawMsg, key) + case "defaultMode": + err = unpopulate(val, "DefaultMode", &g.DefaultMode) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "minAppIdVersion": + err = unpopulate(val, "MinAppIDVersion", &g.MinAppIDVersion) + delete(rawMsg, key) + case "panEtag": + err = unpopulate(val, "PanEtag", &g.PanEtag) + delete(rawMsg, key) + case "panLocation": + err = unpopulate(val, "PanLocation", &g.PanLocation) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &g.Scope) + delete(rawMsg, key) + case "securityServices": + err = unpopulate(val, "SecurityServices", &g.SecurityServices) + 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 IPAddress. +func (i IPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", i.Address) + populate(objectMap, "resourceId", i.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddress. +func (i *IPAddress) UnmarshalJSON(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 "address": + err = unpopulate(val, "Address", &i.Address) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &i.ResourceID) + 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 IPAddressSpace. +func (i IPAddressSpace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressSpace", i.AddressSpace) + populate(objectMap, "resourceId", i.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressSpace. +func (i *IPAddressSpace) UnmarshalJSON(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 "addressSpace": + err = unpopulate(val, "AddressSpace", &i.AddressSpace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &i.ResourceID) + 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 ListAppIDResponse. +func (l ListAppIDResponse) 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 ListAppIDResponse. +func (l *ListAppIDResponse) UnmarshalJSON(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 ListFirewallsResponse. +func (l ListFirewallsResponse) 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 ListFirewallsResponse. +func (l *ListFirewallsResponse) UnmarshalJSON(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 LocalRulesResource. +func (l LocalRulesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalRulesResource. +func (l *LocalRulesResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalRulesResourceListResult. +func (l LocalRulesResourceListResult) 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 LocalRulesResourceListResult. +func (l *LocalRulesResourceListResult) UnmarshalJSON(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 LocalRulestackResource. +func (l LocalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "identity", l.Identity) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalRulestackResource. +func (l *LocalRulestackResource) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &l.Identity) + 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 "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + 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 LocalRulestackResourceListResult. +func (l LocalRulestackResourceListResult) 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 LocalRulestackResourceListResult. +func (l *LocalRulestackResourceListResult) UnmarshalJSON(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 LocalRulestackResourceUpdate. +func (l LocalRulestackResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", l.Identity) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalRulestackResourceUpdate. +func (l *LocalRulestackResourceUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &l.Identity) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalRulestackResourceUpdateProperties. +func (l LocalRulestackResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedSubscriptions", l.AssociatedSubscriptions) + populate(objectMap, "defaultMode", l.DefaultMode) + populate(objectMap, "description", l.Description) + populate(objectMap, "minAppIdVersion", l.MinAppIDVersion) + populate(objectMap, "panEtag", l.PanEtag) + populate(objectMap, "panLocation", l.PanLocation) + populate(objectMap, "scope", l.Scope) + populate(objectMap, "securityServices", l.SecurityServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalRulestackResourceUpdateProperties. +func (l *LocalRulestackResourceUpdateProperties) UnmarshalJSON(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 "associatedSubscriptions": + err = unpopulate(val, "AssociatedSubscriptions", &l.AssociatedSubscriptions) + delete(rawMsg, key) + case "defaultMode": + err = unpopulate(val, "DefaultMode", &l.DefaultMode) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "minAppIdVersion": + err = unpopulate(val, "MinAppIDVersion", &l.MinAppIDVersion) + delete(rawMsg, key) + case "panEtag": + err = unpopulate(val, "PanEtag", &l.PanEtag) + delete(rawMsg, key) + case "panLocation": + err = unpopulate(val, "PanLocation", &l.PanLocation) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &l.Scope) + delete(rawMsg, key) + case "securityServices": + err = unpopulate(val, "SecurityServices", &l.SecurityServices) + 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 LogDestination. +func (l LogDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventHubConfigurations", l.EventHubConfigurations) + populate(objectMap, "monitorConfigurations", l.MonitorConfigurations) + populate(objectMap, "storageConfigurations", l.StorageConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogDestination. +func (l *LogDestination) UnmarshalJSON(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 "eventHubConfigurations": + err = unpopulate(val, "EventHubConfigurations", &l.EventHubConfigurations) + delete(rawMsg, key) + case "monitorConfigurations": + err = unpopulate(val, "MonitorConfigurations", &l.MonitorConfigurations) + delete(rawMsg, key) + case "storageConfigurations": + err = unpopulate(val, "StorageConfigurations", &l.StorageConfigurations) + 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 LogSettings. +func (l LogSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationInsights", l.ApplicationInsights) + populate(objectMap, "commonDestination", l.CommonDestination) + populate(objectMap, "decryptLogDestination", l.DecryptLogDestination) + populate(objectMap, "logOption", l.LogOption) + populate(objectMap, "logType", l.LogType) + populate(objectMap, "threatLogDestination", l.ThreatLogDestination) + populate(objectMap, "trafficLogDestination", l.TrafficLogDestination) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSettings. +func (l *LogSettings) UnmarshalJSON(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 "applicationInsights": + err = unpopulate(val, "ApplicationInsights", &l.ApplicationInsights) + delete(rawMsg, key) + case "commonDestination": + err = unpopulate(val, "CommonDestination", &l.CommonDestination) + delete(rawMsg, key) + case "decryptLogDestination": + err = unpopulate(val, "DecryptLogDestination", &l.DecryptLogDestination) + delete(rawMsg, key) + case "logOption": + err = unpopulate(val, "LogOption", &l.LogOption) + delete(rawMsg, key) + case "logType": + err = unpopulate(val, "LogType", &l.LogType) + delete(rawMsg, key) + case "threatLogDestination": + err = unpopulate(val, "ThreatLogDestination", &l.ThreatLogDestination) + delete(rawMsg, key) + case "trafficLogDestination": + err = unpopulate(val, "TrafficLogDestination", &l.TrafficLogDestination) + 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 MarketplaceDetails. +func (m MarketplaceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "marketplaceSubscriptionId", m.MarketplaceSubscriptionID) + populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) + populate(objectMap, "offerId", m.OfferID) + populate(objectMap, "publisherId", m.PublisherID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceDetails. +func (m *MarketplaceDetails) UnmarshalJSON(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 "marketplaceSubscriptionId": + err = unpopulate(val, "MarketplaceSubscriptionID", &m.MarketplaceSubscriptionID) + delete(rawMsg, key) + case "marketplaceSubscriptionStatus": + err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) + delete(rawMsg, key) + case "offerId": + err = unpopulate(val, "OfferID", &m.OfferID) + delete(rawMsg, key) + case "publisherId": + err = unpopulate(val, "PublisherID", &m.PublisherID) + 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 MonitorLog. +func (m MonitorLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "primaryKey", m.PrimaryKey) + populate(objectMap, "secondaryKey", m.SecondaryKey) + populate(objectMap, "subscriptionId", m.SubscriptionID) + populate(objectMap, "workspace", m.Workspace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorLog. +func (m *MonitorLog) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &m.PrimaryKey) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &m.SecondaryKey) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &m.SubscriptionID) + delete(rawMsg, key) + case "workspace": + err = unpopulate(val, "Workspace", &m.Workspace) + 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 NameDescriptionObject. +func (n NameDescriptionObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameDescriptionObject. +func (n *NameDescriptionObject) UnmarshalJSON(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 "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 NetworkProfile. +func (n NetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egressNatIp", n.EgressNatIP) + populate(objectMap, "enableEgressNat", n.EnableEgressNat) + populate(objectMap, "networkType", n.NetworkType) + populate(objectMap, "publicIps", n.PublicIPs) + populate(objectMap, "vnetConfiguration", n.VnetConfiguration) + populate(objectMap, "vwanConfiguration", n.VwanConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. +func (n *NetworkProfile) UnmarshalJSON(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 "egressNatIp": + err = unpopulate(val, "EgressNatIP", &n.EgressNatIP) + delete(rawMsg, key) + case "enableEgressNat": + err = unpopulate(val, "EnableEgressNat", &n.EnableEgressNat) + delete(rawMsg, key) + case "networkType": + err = unpopulate(val, "NetworkType", &n.NetworkType) + delete(rawMsg, key) + case "publicIps": + err = unpopulate(val, "PublicIPs", &n.PublicIPs) + delete(rawMsg, key) + case "vnetConfiguration": + err = unpopulate(val, "VnetConfiguration", &n.VnetConfiguration) + delete(rawMsg, key) + case "vwanConfiguration": + err = unpopulate(val, "VwanConfiguration", &n.VwanConfiguration) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + 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) + } + 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 PanoramaConfig. +func (p PanoramaConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cgName", p.CgName) + populate(objectMap, "configString", p.ConfigString) + populate(objectMap, "dgName", p.DgName) + populate(objectMap, "hostName", p.HostName) + populate(objectMap, "panoramaServer", p.PanoramaServer) + populate(objectMap, "panoramaServer2", p.PanoramaServer2) + populate(objectMap, "tplName", p.TplName) + populate(objectMap, "vmAuthKey", p.VMAuthKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PanoramaConfig. +func (p *PanoramaConfig) UnmarshalJSON(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 "cgName": + err = unpopulate(val, "CgName", &p.CgName) + delete(rawMsg, key) + case "configString": + err = unpopulate(val, "ConfigString", &p.ConfigString) + delete(rawMsg, key) + case "dgName": + err = unpopulate(val, "DgName", &p.DgName) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &p.HostName) + delete(rawMsg, key) + case "panoramaServer": + err = unpopulate(val, "PanoramaServer", &p.PanoramaServer) + delete(rawMsg, key) + case "panoramaServer2": + err = unpopulate(val, "PanoramaServer2", &p.PanoramaServer2) + delete(rawMsg, key) + case "tplName": + err = unpopulate(val, "TplName", &p.TplName) + delete(rawMsg, key) + case "vmAuthKey": + err = unpopulate(val, "VMAuthKey", &p.VMAuthKey) + 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 PanoramaStatus. +func (p PanoramaStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "panoramaServer2Status", p.PanoramaServer2Status) + populate(objectMap, "panoramaServerStatus", p.PanoramaServerStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PanoramaStatus. +func (p *PanoramaStatus) UnmarshalJSON(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 "panoramaServer2Status": + err = unpopulate(val, "PanoramaServer2Status", &p.PanoramaServer2Status) + delete(rawMsg, key) + case "panoramaServerStatus": + err = unpopulate(val, "PanoramaServerStatus", &p.PanoramaServerStatus) + 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 PlanData. +func (p PlanData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "billingCycle", p.BillingCycle) + populateTimeRFC3339(objectMap, "effectiveDate", p.EffectiveDate) + populate(objectMap, "planId", p.PlanID) + populate(objectMap, "usageType", p.UsageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlanData. +func (p *PlanData) UnmarshalJSON(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 "billingCycle": + err = unpopulate(val, "BillingCycle", &p.BillingCycle) + delete(rawMsg, key) + case "effectiveDate": + err = unpopulateTimeRFC3339(val, "EffectiveDate", &p.EffectiveDate) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &p.PlanID) + delete(rawMsg, key) + case "usageType": + err = unpopulate(val, "UsageType", &p.UsageType) + 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 PostRulesResource. +func (p PostRulesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostRulesResource. +func (p *PostRulesResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PostRulesResourceListResult. +func (p PostRulesResourceListResult) 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 PostRulesResourceListResult. +func (p *PostRulesResourceListResult) UnmarshalJSON(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 PreRulesResource. +func (p PreRulesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreRulesResource. +func (p *PreRulesResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PreRulesResourceListResult. +func (p PreRulesResourceListResult) 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 PreRulesResourceListResult. +func (p *PreRulesResourceListResult) UnmarshalJSON(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 PredefinedURLCategoriesResponse. +func (p PredefinedURLCategoriesResponse) 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 PredefinedURLCategoriesResponse. +func (p *PredefinedURLCategoriesResponse) UnmarshalJSON(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 PredefinedURLCategory. +func (p PredefinedURLCategory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", p.Action) + populate(objectMap, "name", p.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PredefinedURLCategory. +func (p *PredefinedURLCategory) UnmarshalJSON(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 "action": + err = unpopulate(val, "Action", &p.Action) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + 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 PrefixListGlobalRulestackResource. +func (p PrefixListGlobalRulestackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrefixListGlobalRulestackResource. +func (p *PrefixListGlobalRulestackResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrefixListGlobalRulestackResourceListResult. +func (p PrefixListGlobalRulestackResourceListResult) 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 PrefixListGlobalRulestackResourceListResult. +func (p *PrefixListGlobalRulestackResourceListResult) UnmarshalJSON(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 PrefixListResource. +func (p PrefixListResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrefixListResource. +func (p *PrefixListResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrefixListResourceListResult. +func (p PrefixListResourceListResult) 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 PrefixListResourceListResult. +func (p *PrefixListResourceListResult) UnmarshalJSON(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 PrefixObject. +func (p PrefixObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditComment", p.AuditComment) + populate(objectMap, "description", p.Description) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "prefixList", p.PrefixList) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrefixObject. +func (p *PrefixObject) UnmarshalJSON(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 "auditComment": + err = unpopulate(val, "AuditComment", &p.AuditComment) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &p.Etag) + delete(rawMsg, key) + case "prefixList": + err = unpopulate(val, "PrefixList", &p.PrefixList) + 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 RuleCounter. +func (r RuleCounter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appSeen", r.AppSeen) + populate(objectMap, "firewallName", r.FirewallName) + populate(objectMap, "hitCount", r.HitCount) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", r.LastUpdatedTimestamp) + populate(objectMap, "priority", r.Priority) + populateTimeRFC3339(objectMap, "requestTimestamp", r.RequestTimestamp) + populate(objectMap, "ruleListName", r.RuleListName) + populate(objectMap, "ruleName", r.RuleName) + populate(objectMap, "ruleStackName", r.RuleStackName) + populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleCounter. +func (r *RuleCounter) UnmarshalJSON(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 "appSeen": + err = unpopulate(val, "AppSeen", &r.AppSeen) + delete(rawMsg, key) + case "firewallName": + err = unpopulate(val, "FirewallName", &r.FirewallName) + delete(rawMsg, key) + case "hitCount": + err = unpopulate(val, "HitCount", &r.HitCount) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &r.LastUpdatedTimestamp) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &r.Priority) + delete(rawMsg, key) + case "requestTimestamp": + err = unpopulateTimeRFC3339(val, "RequestTimestamp", &r.RequestTimestamp) + delete(rawMsg, key) + case "ruleListName": + err = unpopulate(val, "RuleListName", &r.RuleListName) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &r.RuleName) + delete(rawMsg, key) + case "ruleStackName": + err = unpopulate(val, "RuleStackName", &r.RuleStackName) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + 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 RuleCounterReset. +func (r RuleCounterReset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "firewallName", r.FirewallName) + populate(objectMap, "priority", r.Priority) + populate(objectMap, "ruleListName", r.RuleListName) + populate(objectMap, "ruleName", r.RuleName) + populate(objectMap, "ruleStackName", r.RuleStackName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleCounterReset. +func (r *RuleCounterReset) UnmarshalJSON(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 "firewallName": + err = unpopulate(val, "FirewallName", &r.FirewallName) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &r.Priority) + delete(rawMsg, key) + case "ruleListName": + err = unpopulate(val, "RuleListName", &r.RuleListName) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &r.RuleName) + delete(rawMsg, key) + case "ruleStackName": + err = unpopulate(val, "RuleStackName", &r.RuleStackName) + 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 RuleEntry. +func (r RuleEntry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", r.ActionType) + populate(objectMap, "applications", r.Applications) + populate(objectMap, "auditComment", r.AuditComment) + populate(objectMap, "category", r.Category) + populate(objectMap, "decryptionRuleType", r.DecryptionRuleType) + populate(objectMap, "description", r.Description) + populate(objectMap, "destination", r.Destination) + populate(objectMap, "enableLogging", r.EnableLogging) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "inboundInspectionCertificate", r.InboundInspectionCertificate) + populate(objectMap, "negateDestination", r.NegateDestination) + populate(objectMap, "negateSource", r.NegateSource) + populate(objectMap, "priority", r.Priority) + populate(objectMap, "protocol", r.Protocol) + populate(objectMap, "protocolPortList", r.ProtocolPortList) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "ruleName", r.RuleName) + populate(objectMap, "ruleState", r.RuleState) + populate(objectMap, "source", r.Source) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleEntry. +func (r *RuleEntry) UnmarshalJSON(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 "actionType": + err = unpopulate(val, "ActionType", &r.ActionType) + delete(rawMsg, key) + case "applications": + err = unpopulate(val, "Applications", &r.Applications) + delete(rawMsg, key) + case "auditComment": + err = unpopulate(val, "AuditComment", &r.AuditComment) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &r.Category) + delete(rawMsg, key) + case "decryptionRuleType": + err = unpopulate(val, "DecryptionRuleType", &r.DecryptionRuleType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &r.Destination) + delete(rawMsg, key) + case "enableLogging": + err = unpopulate(val, "EnableLogging", &r.EnableLogging) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "inboundInspectionCertificate": + err = unpopulate(val, "InboundInspectionCertificate", &r.InboundInspectionCertificate) + delete(rawMsg, key) + case "negateDestination": + err = unpopulate(val, "NegateDestination", &r.NegateDestination) + delete(rawMsg, key) + case "negateSource": + err = unpopulate(val, "NegateSource", &r.NegateSource) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &r.Priority) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &r.Protocol) + delete(rawMsg, key) + case "protocolPortList": + err = unpopulate(val, "ProtocolPortList", &r.ProtocolPortList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &r.RuleName) + delete(rawMsg, key) + case "ruleState": + err = unpopulate(val, "RuleState", &r.RuleState) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &r.Source) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 RulestackDetails. +func (r RulestackDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", r.Location) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "rulestackId", r.RulestackID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RulestackDetails. +func (r *RulestackDetails) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "rulestackId": + err = unpopulate(val, "RulestackID", &r.RulestackID) + 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 RulestackProperties. +func (r RulestackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "associatedSubscriptions", r.AssociatedSubscriptions) + populate(objectMap, "defaultMode", r.DefaultMode) + populate(objectMap, "description", r.Description) + populate(objectMap, "minAppIdVersion", r.MinAppIDVersion) + populate(objectMap, "panEtag", r.PanEtag) + populate(objectMap, "panLocation", r.PanLocation) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "scope", r.Scope) + populate(objectMap, "securityServices", r.SecurityServices) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RulestackProperties. +func (r *RulestackProperties) UnmarshalJSON(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 "associatedSubscriptions": + err = unpopulate(val, "AssociatedSubscriptions", &r.AssociatedSubscriptions) + delete(rawMsg, key) + case "defaultMode": + err = unpopulate(val, "DefaultMode", &r.DefaultMode) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "minAppIdVersion": + err = unpopulate(val, "MinAppIDVersion", &r.MinAppIDVersion) + delete(rawMsg, key) + case "panEtag": + err = unpopulate(val, "PanEtag", &r.PanEtag) + delete(rawMsg, key) + case "panLocation": + err = unpopulate(val, "PanLocation", &r.PanLocation) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &r.Scope) + delete(rawMsg, key) + case "securityServices": + err = unpopulate(val, "SecurityServices", &r.SecurityServices) + 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 SecurityServices. +func (s SecurityServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "antiSpywareProfile", s.AntiSpywareProfile) + populate(objectMap, "antiVirusProfile", s.AntiVirusProfile) + populate(objectMap, "dnsSubscription", s.DNSSubscription) + populate(objectMap, "fileBlockingProfile", s.FileBlockingProfile) + populate(objectMap, "outboundTrustCertificate", s.OutboundTrustCertificate) + populate(objectMap, "outboundUnTrustCertificate", s.OutboundUnTrustCertificate) + populate(objectMap, "urlFilteringProfile", s.URLFilteringProfile) + populate(objectMap, "vulnerabilityProfile", s.VulnerabilityProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityServices. +func (s *SecurityServices) UnmarshalJSON(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 "antiSpywareProfile": + err = unpopulate(val, "AntiSpywareProfile", &s.AntiSpywareProfile) + delete(rawMsg, key) + case "antiVirusProfile": + err = unpopulate(val, "AntiVirusProfile", &s.AntiVirusProfile) + delete(rawMsg, key) + case "dnsSubscription": + err = unpopulate(val, "DNSSubscription", &s.DNSSubscription) + delete(rawMsg, key) + case "fileBlockingProfile": + err = unpopulate(val, "FileBlockingProfile", &s.FileBlockingProfile) + delete(rawMsg, key) + case "outboundTrustCertificate": + err = unpopulate(val, "OutboundTrustCertificate", &s.OutboundTrustCertificate) + delete(rawMsg, key) + case "outboundUnTrustCertificate": + err = unpopulate(val, "OutboundUnTrustCertificate", &s.OutboundUnTrustCertificate) + delete(rawMsg, key) + case "urlFilteringProfile": + err = unpopulate(val, "URLFilteringProfile", &s.URLFilteringProfile) + delete(rawMsg, key) + case "vulnerabilityProfile": + err = unpopulate(val, "VulnerabilityProfile", &s.VulnerabilityProfile) + 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 SecurityServicesResponse. +func (s SecurityServicesResponse) 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 SecurityServicesResponse. +func (s *SecurityServicesResponse) UnmarshalJSON(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 SecurityServicesTypeList. +func (s SecurityServicesTypeList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "entry", s.Entry) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityServicesTypeList. +func (s *SecurityServicesTypeList) UnmarshalJSON(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 "entry": + err = unpopulate(val, "Entry", &s.Entry) + 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 SourceAddr. +func (s SourceAddr) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cidrs", s.Cidrs) + populate(objectMap, "countries", s.Countries) + populate(objectMap, "feeds", s.Feeds) + populate(objectMap, "prefixLists", s.PrefixLists) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceAddr. +func (s *SourceAddr) UnmarshalJSON(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 "cidrs": + err = unpopulate(val, "Cidrs", &s.Cidrs) + delete(rawMsg, key) + case "countries": + err = unpopulate(val, "Countries", &s.Countries) + delete(rawMsg, key) + case "feeds": + err = unpopulate(val, "Feeds", &s.Feeds) + delete(rawMsg, key) + case "prefixLists": + err = unpopulate(val, "PrefixLists", &s.PrefixLists) + 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 StorageAccount. +func (s StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountName", s.AccountName) + populate(objectMap, "id", s.ID) + populate(objectMap, "subscriptionId", s.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. +func (s *StorageAccount) UnmarshalJSON(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 "accountName": + err = unpopulate(val, "AccountName", &s.AccountName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &s.SubscriptionID) + 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 SupportInfo. +func (s SupportInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountId", s.AccountID) + populate(objectMap, "accountRegistered", s.AccountRegistered) + populate(objectMap, "freeTrial", s.FreeTrial) + populate(objectMap, "freeTrialCreditLeft", s.FreeTrialCreditLeft) + populate(objectMap, "freeTrialDaysLeft", s.FreeTrialDaysLeft) + populate(objectMap, "helpURL", s.HelpURL) + populate(objectMap, "productSku", s.ProductSKU) + populate(objectMap, "productSerial", s.ProductSerial) + populate(objectMap, "registerURL", s.RegisterURL) + populate(objectMap, "supportURL", s.SupportURL) + populate(objectMap, "userDomainSupported", s.UserDomainSupported) + populate(objectMap, "userRegistered", s.UserRegistered) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportInfo. +func (s *SupportInfo) UnmarshalJSON(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 "accountId": + err = unpopulate(val, "AccountID", &s.AccountID) + delete(rawMsg, key) + case "accountRegistered": + err = unpopulate(val, "AccountRegistered", &s.AccountRegistered) + delete(rawMsg, key) + case "freeTrial": + err = unpopulate(val, "FreeTrial", &s.FreeTrial) + delete(rawMsg, key) + case "freeTrialCreditLeft": + err = unpopulate(val, "FreeTrialCreditLeft", &s.FreeTrialCreditLeft) + delete(rawMsg, key) + case "freeTrialDaysLeft": + err = unpopulate(val, "FreeTrialDaysLeft", &s.FreeTrialDaysLeft) + delete(rawMsg, key) + case "helpURL": + err = unpopulate(val, "HelpURL", &s.HelpURL) + delete(rawMsg, key) + case "productSku": + err = unpopulate(val, "ProductSKU", &s.ProductSKU) + delete(rawMsg, key) + case "productSerial": + err = unpopulate(val, "ProductSerial", &s.ProductSerial) + delete(rawMsg, key) + case "registerURL": + err = unpopulate(val, "RegisterURL", &s.RegisterURL) + delete(rawMsg, key) + case "supportURL": + err = unpopulate(val, "SupportURL", &s.SupportURL) + delete(rawMsg, key) + case "userDomainSupported": + err = unpopulate(val, "UserDomainSupported", &s.UserDomainSupported) + delete(rawMsg, key) + case "userRegistered": + err = unpopulate(val, "UserRegistered", &s.UserRegistered) + 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 TagInfo. +func (t TagInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", t.Key) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagInfo. +func (t *TagInfo) UnmarshalJSON(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 "key": + err = unpopulate(val, "Key", &t.Key) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VnetConfiguration. +func (v VnetConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipOfTrustSubnetForUdr", v.IPOfTrustSubnetForUdr) + populate(objectMap, "trustSubnet", v.TrustSubnet) + populate(objectMap, "unTrustSubnet", v.UnTrustSubnet) + populate(objectMap, "vnet", v.Vnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VnetConfiguration. +func (v *VnetConfiguration) UnmarshalJSON(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 "ipOfTrustSubnetForUdr": + err = unpopulate(val, "IPOfTrustSubnetForUdr", &v.IPOfTrustSubnetForUdr) + delete(rawMsg, key) + case "trustSubnet": + err = unpopulate(val, "TrustSubnet", &v.TrustSubnet) + delete(rawMsg, key) + case "unTrustSubnet": + err = unpopulate(val, "UnTrustSubnet", &v.UnTrustSubnet) + delete(rawMsg, key) + case "vnet": + err = unpopulate(val, "Vnet", &v.Vnet) + 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 VwanConfiguration. +func (v VwanConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipOfTrustSubnetForUdr", v.IPOfTrustSubnetForUdr) + populate(objectMap, "networkVirtualApplianceId", v.NetworkVirtualApplianceID) + populate(objectMap, "trustSubnet", v.TrustSubnet) + populate(objectMap, "unTrustSubnet", v.UnTrustSubnet) + populate(objectMap, "vHub", v.VHub) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VwanConfiguration. +func (v *VwanConfiguration) UnmarshalJSON(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 "ipOfTrustSubnetForUdr": + err = unpopulate(val, "IPOfTrustSubnetForUdr", &v.IPOfTrustSubnetForUdr) + delete(rawMsg, key) + case "networkVirtualApplianceId": + err = unpopulate(val, "NetworkVirtualApplianceID", &v.NetworkVirtualApplianceID) + delete(rawMsg, key) + case "trustSubnet": + err = unpopulate(val, "TrustSubnet", &v.TrustSubnet) + delete(rawMsg, key) + case "unTrustSubnet": + err = unpopulate(val, "UnTrustSubnet", &v.UnTrustSubnet) + delete(rawMsg, key) + case "vHub": + err = unpopulate(val, "VHub", &v.VHub) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func 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/paloaltonetworksngfw/armpanngfw/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client.go new file mode 100644 index 00000000..16eaf70c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/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 armpanngfw + +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 - List the operations for the provider +// +// Generated from API version 2022-08-29 +// - 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/PaloAltoNetworks.Cloudngfw/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-08-29") + 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/paloaltonetworksngfw/armpanngfw/postrules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go new file mode 100644 index 00000000..8a5f11ee --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go @@ -0,0 +1,441 @@ +//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 armpanngfw + +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" +) + +// PostRulesClient contains the methods for the PostRules group. +// Don't use this type directly, use NewPostRulesClient() instead. +type PostRulesClient struct { + internal *arm.Client +} + +// NewPostRulesClient creates a new instance of PostRulesClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPostRulesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PostRulesClient, error) { + cl, err := arm.NewClient(moduleName+".PostRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PostRulesClient{ + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a PostRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - resource - Resource create parameters. +// - options - PostRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the PostRulesClient.BeginCreateOrUpdate +// method. +func (client *PostRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PostRulesResource, options *PostRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PostRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, priority, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PostRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a PostRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PostRulesClient) createOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PostRulesResource, options *PostRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, priority, resource, 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 *PostRulesClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, priority string, resource PostRulesResource, options *PostRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a PostRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - options - PostRulesClientBeginDeleteOptions contains the optional parameters for the PostRulesClient.BeginDelete method. +func (client *PostRulesClient) BeginDelete(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientBeginDeleteOptions) (*runtime.Poller[PostRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, priority, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PostRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a PostRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PostRulesClient) deleteOperation(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, priority, 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 *PostRulesClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a PostRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - options - PostRulesClientGetOptions contains the optional parameters for the PostRulesClient.Get method. +func (client *PostRulesClient) Get(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientGetOptions) (PostRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PostRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PostRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PostRulesClient) getCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PostRulesClient) getHandleResponse(resp *http.Response) (PostRulesClientGetResponse, error) { + result := PostRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PostRulesResource); err != nil { + return PostRulesClientGetResponse{}, err + } + return result, nil +} + +// GetCounters - Get counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - options - PostRulesClientGetCountersOptions contains the optional parameters for the PostRulesClient.GetCounters method. +func (client *PostRulesClient) GetCounters(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientGetCountersOptions) (PostRulesClientGetCountersResponse, error) { + req, err := client.getCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PostRulesClientGetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostRulesClientGetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PostRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.getCountersHandleResponse(resp) +} + +// getCountersCreateRequest creates the GetCounters request. +func (client *PostRulesClient) getCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientGetCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}/getCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCountersHandleResponse handles the GetCounters response. +func (client *PostRulesClient) getCountersHandleResponse(resp *http.Response) (PostRulesClientGetCountersResponse, error) { + result := PostRulesClientGetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounter); err != nil { + return PostRulesClientGetCountersResponse{}, err + } + return result, nil +} + +// NewListPager - List PostRulesResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - PostRulesClientListOptions contains the optional parameters for the PostRulesClient.NewListPager method. +func (client *PostRulesClient) NewListPager(globalRulestackName string, options *PostRulesClientListOptions) *runtime.Pager[PostRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PostRulesClientListResponse]{ + More: func(page PostRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PostRulesClientListResponse) (PostRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, globalRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PostRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PostRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PostRulesClient) listCreateRequest(ctx context.Context, globalRulestackName string, options *PostRulesClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PostRulesClient) listHandleResponse(resp *http.Response) (PostRulesClientListResponse, error) { + result := PostRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PostRulesResourceListResult); err != nil { + return PostRulesClientListResponse{}, err + } + return result, nil +} + +// RefreshCounters - Refresh counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - options - PostRulesClientRefreshCountersOptions contains the optional parameters for the PostRulesClient.RefreshCounters +// method. +func (client *PostRulesClient) RefreshCounters(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientRefreshCountersOptions) (PostRulesClientRefreshCountersResponse, error) { + req, err := client.refreshCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PostRulesClientRefreshCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostRulesClientRefreshCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return PostRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + } + return PostRulesClientRefreshCountersResponse{}, nil +} + +// refreshCountersCreateRequest creates the RefreshCounters request. +func (client *PostRulesClient) refreshCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientRefreshCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}/refreshCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// ResetCounters - Reset counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Post Rule priority +// - options - PostRulesClientResetCountersOptions contains the optional parameters for the PostRulesClient.ResetCounters method. +func (client *PostRulesClient) ResetCounters(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientResetCountersOptions) (PostRulesClientResetCountersResponse, error) { + req, err := client.resetCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PostRulesClientResetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PostRulesClientResetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PostRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.resetCountersHandleResponse(resp) +} + +// resetCountersCreateRequest creates the ResetCounters request. +func (client *PostRulesClient) resetCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientResetCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/postRules/{priority}/resetCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// resetCountersHandleResponse handles the ResetCounters response. +func (client *PostRulesClient) resetCountersHandleResponse(resp *http.Response) (PostRulesClientResetCountersResponse, error) { + result := PostRulesClientResetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounterReset); err != nil { + return PostRulesClientResetCountersResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go new file mode 100644 index 00000000..dd308d09 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go @@ -0,0 +1,284 @@ +//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 armpanngfw + +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" +) + +// PrefixListGlobalRulestackClient contains the methods for the PrefixListGlobalRulestack group. +// Don't use this type directly, use NewPrefixListGlobalRulestackClient() instead. +type PrefixListGlobalRulestackClient struct { + internal *arm.Client +} + +// NewPrefixListGlobalRulestackClient creates a new instance of PrefixListGlobalRulestackClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrefixListGlobalRulestackClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PrefixListGlobalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".PrefixListGlobalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrefixListGlobalRulestackClient{ + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a PrefixListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - Local Rule priority +// - resource - Resource create parameters. +// - options - PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the PrefixListGlobalRulestackClient.BeginCreateOrUpdate +// method. +func (client *PrefixListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, name string, resource PrefixListGlobalRulestackResource, options *PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrefixListGlobalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrefixListGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a PrefixListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PrefixListGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource PrefixListGlobalRulestackResource, options *PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, 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 *PrefixListGlobalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, name string, resource PrefixListGlobalRulestackResource, options *PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/prefixlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a PrefixListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - Local Rule priority +// - options - PrefixListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the PrefixListGlobalRulestackClient.BeginDelete +// method. +func (client *PrefixListGlobalRulestackClient) BeginDelete(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientBeginDeleteOptions) (*runtime.Poller[PrefixListGlobalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrefixListGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a PrefixListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PrefixListGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, 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 *PrefixListGlobalRulestackClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/prefixlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a PrefixListGlobalRulestackResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - name - Local Rule priority +// - options - PrefixListGlobalRulestackClientGetOptions contains the optional parameters for the PrefixListGlobalRulestackClient.Get +// method. +func (client *PrefixListGlobalRulestackClient) Get(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientGetOptions) (PrefixListGlobalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) + if err != nil { + return PrefixListGlobalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrefixListGlobalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrefixListGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrefixListGlobalRulestackClient) getCreateRequest(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/prefixlists/{name}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrefixListGlobalRulestackClient) getHandleResponse(resp *http.Response) (PrefixListGlobalRulestackClientGetResponse, error) { + result := PrefixListGlobalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrefixListGlobalRulestackResource); err != nil { + return PrefixListGlobalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List PrefixListGlobalRulestackResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - PrefixListGlobalRulestackClientListOptions contains the optional parameters for the PrefixListGlobalRulestackClient.NewListPager +// method. +func (client *PrefixListGlobalRulestackClient) NewListPager(globalRulestackName string, options *PrefixListGlobalRulestackClientListOptions) *runtime.Pager[PrefixListGlobalRulestackClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrefixListGlobalRulestackClientListResponse]{ + More: func(page PrefixListGlobalRulestackClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrefixListGlobalRulestackClientListResponse) (PrefixListGlobalRulestackClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, globalRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrefixListGlobalRulestackClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrefixListGlobalRulestackClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrefixListGlobalRulestackClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrefixListGlobalRulestackClient) listCreateRequest(ctx context.Context, globalRulestackName string, options *PrefixListGlobalRulestackClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/prefixlists" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrefixListGlobalRulestackClient) listHandleResponse(resp *http.Response) (PrefixListGlobalRulestackClientListResponse, error) { + result := PrefixListGlobalRulestackClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrefixListGlobalRulestackResourceListResult); err != nil { + return PrefixListGlobalRulestackClientListResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go new file mode 100644 index 00000000..dc2c1387 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_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 armpanngfw + +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" +) + +// PrefixListLocalRulestackClient contains the methods for the PrefixListLocalRulestack group. +// Don't use this type directly, use NewPrefixListLocalRulestackClient() instead. +type PrefixListLocalRulestackClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPrefixListLocalRulestackClient creates a new instance of PrefixListLocalRulestackClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPrefixListLocalRulestackClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrefixListLocalRulestackClient, error) { + cl, err := arm.NewClient(moduleName+".PrefixListLocalRulestackClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PrefixListLocalRulestackClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a PrefixListResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - Local Rule priority +// - resource - Resource create parameters. +// - options - PrefixListLocalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the PrefixListLocalRulestackClient.BeginCreateOrUpdate +// method. +func (client *PrefixListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource PrefixListResource, options *PrefixListLocalRulestackClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrefixListLocalRulestackClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, localRulestackName, name, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrefixListLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a PrefixListResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PrefixListLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource PrefixListResource, options *PrefixListLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, 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 *PrefixListLocalRulestackClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource PrefixListResource, options *PrefixListLocalRulestackClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/prefixlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a PrefixListResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - Local Rule priority +// - options - PrefixListLocalRulestackClientBeginDeleteOptions contains the optional parameters for the PrefixListLocalRulestackClient.BeginDelete +// method. +func (client *PrefixListLocalRulestackClient) BeginDelete(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientBeginDeleteOptions) (*runtime.Poller[PrefixListLocalRulestackClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PrefixListLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a PrefixListResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PrefixListLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, 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 *PrefixListLocalRulestackClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/prefixlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a PrefixListResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - name - Local Rule priority +// - options - PrefixListLocalRulestackClientGetOptions contains the optional parameters for the PrefixListLocalRulestackClient.Get +// method. +func (client *PrefixListLocalRulestackClient) Get(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientGetOptions) (PrefixListLocalRulestackClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) + if err != nil { + return PrefixListLocalRulestackClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrefixListLocalRulestackClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrefixListLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrefixListLocalRulestackClient) getCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/prefixlists/{name}" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrefixListLocalRulestackClient) getHandleResponse(resp *http.Response) (PrefixListLocalRulestackClientGetResponse, error) { + result := PrefixListLocalRulestackClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrefixListResource); err != nil { + return PrefixListLocalRulestackClientGetResponse{}, err + } + return result, nil +} + +// NewListByLocalRulestacksPager - List PrefixListResource resources by LocalRulestacks +// +// Generated from API version 2022-08-29 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - localRulestackName - LocalRulestack resource name +// - options - PrefixListLocalRulestackClientListByLocalRulestacksOptions contains the optional parameters for the PrefixListLocalRulestackClient.NewListByLocalRulestacksPager +// method. +func (client *PrefixListLocalRulestackClient) NewListByLocalRulestacksPager(resourceGroupName string, localRulestackName string, options *PrefixListLocalRulestackClientListByLocalRulestacksOptions) *runtime.Pager[PrefixListLocalRulestackClientListByLocalRulestacksResponse] { + return runtime.NewPager(runtime.PagingHandler[PrefixListLocalRulestackClientListByLocalRulestacksResponse]{ + More: func(page PrefixListLocalRulestackClientListByLocalRulestacksResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrefixListLocalRulestackClientListByLocalRulestacksResponse) (PrefixListLocalRulestackClientListByLocalRulestacksResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocalRulestacksCreateRequest(ctx, resourceGroupName, localRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrefixListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrefixListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrefixListLocalRulestackClientListByLocalRulestacksResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocalRulestacksHandleResponse(resp) + }, + }) +} + +// listByLocalRulestacksCreateRequest creates the ListByLocalRulestacks request. +func (client *PrefixListLocalRulestackClient) listByLocalRulestacksCreateRequest(ctx context.Context, resourceGroupName string, localRulestackName string, options *PrefixListLocalRulestackClientListByLocalRulestacksOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName}/prefixlists" + 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 localRulestackName == "" { + return nil, errors.New("parameter localRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{localRulestackName}", url.PathEscape(localRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocalRulestacksHandleResponse handles the ListByLocalRulestacks response. +func (client *PrefixListLocalRulestackClient) listByLocalRulestacksHandleResponse(resp *http.Response) (PrefixListLocalRulestackClientListByLocalRulestacksResponse, error) { + result := PrefixListLocalRulestackClientListByLocalRulestacksResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrefixListResourceListResult); err != nil { + return PrefixListLocalRulestackClientListByLocalRulestacksResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go new file mode 100644 index 00000000..df91f4f6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go @@ -0,0 +1,441 @@ +//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 armpanngfw + +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" +) + +// PreRulesClient contains the methods for the PreRules group. +// Don't use this type directly, use NewPreRulesClient() instead. +type PreRulesClient struct { + internal *arm.Client +} + +// NewPreRulesClient creates a new instance of PreRulesClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPreRulesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PreRulesClient, error) { + cl, err := arm.NewClient(moduleName+".PreRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PreRulesClient{ + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a PreRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - resource - Resource create parameters. +// - options - PreRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the PreRulesClient.BeginCreateOrUpdate +// method. +func (client *PreRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PreRulesResource, options *PreRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PreRulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, globalRulestackName, priority, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PreRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a PreRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PreRulesClient) createOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PreRulesResource, options *PreRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, priority, resource, 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 *PreRulesClient) createOrUpdateCreateRequest(ctx context.Context, globalRulestackName string, priority string, resource PreRulesResource, options *PreRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a PreRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - options - PreRulesClientBeginDeleteOptions contains the optional parameters for the PreRulesClient.BeginDelete method. +func (client *PreRulesClient) BeginDelete(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientBeginDeleteOptions) (*runtime.Poller[PreRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, globalRulestackName, priority, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PreRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a PreRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +func (client *PreRulesClient) deleteOperation(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, globalRulestackName, priority, 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 *PreRulesClient) deleteCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a PreRulesResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - options - PreRulesClientGetOptions contains the optional parameters for the PreRulesClient.Get method. +func (client *PreRulesClient) Get(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientGetOptions) (PreRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PreRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PreRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PreRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PreRulesClient) getCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PreRulesClient) getHandleResponse(resp *http.Response) (PreRulesClientGetResponse, error) { + result := PreRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PreRulesResource); err != nil { + return PreRulesClientGetResponse{}, err + } + return result, nil +} + +// GetCounters - Get counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - options - PreRulesClientGetCountersOptions contains the optional parameters for the PreRulesClient.GetCounters method. +func (client *PreRulesClient) GetCounters(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientGetCountersOptions) (PreRulesClientGetCountersResponse, error) { + req, err := client.getCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PreRulesClientGetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PreRulesClientGetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PreRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.getCountersHandleResponse(resp) +} + +// getCountersCreateRequest creates the GetCounters request. +func (client *PreRulesClient) getCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientGetCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}/getCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCountersHandleResponse handles the GetCounters response. +func (client *PreRulesClient) getCountersHandleResponse(resp *http.Response) (PreRulesClientGetCountersResponse, error) { + result := PreRulesClientGetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounter); err != nil { + return PreRulesClientGetCountersResponse{}, err + } + return result, nil +} + +// NewListPager - List PreRulesResource resources by Tenant +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - options - PreRulesClientListOptions contains the optional parameters for the PreRulesClient.NewListPager method. +func (client *PreRulesClient) NewListPager(globalRulestackName string, options *PreRulesClientListOptions) *runtime.Pager[PreRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PreRulesClientListResponse]{ + More: func(page PreRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PreRulesClientListResponse) (PreRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, globalRulestackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PreRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PreRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PreRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PreRulesClient) listCreateRequest(ctx context.Context, globalRulestackName string, options *PreRulesClientListOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PreRulesClient) listHandleResponse(resp *http.Response) (PreRulesClientListResponse, error) { + result := PreRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PreRulesResourceListResult); err != nil { + return PreRulesClientListResponse{}, err + } + return result, nil +} + +// RefreshCounters - Refresh counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - options - PreRulesClientRefreshCountersOptions contains the optional parameters for the PreRulesClient.RefreshCounters +// method. +func (client *PreRulesClient) RefreshCounters(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientRefreshCountersOptions) (PreRulesClientRefreshCountersResponse, error) { + req, err := client.refreshCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PreRulesClientRefreshCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PreRulesClientRefreshCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return PreRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + } + return PreRulesClientRefreshCountersResponse{}, nil +} + +// refreshCountersCreateRequest creates the RefreshCounters request. +func (client *PreRulesClient) refreshCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientRefreshCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}/refreshCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// ResetCounters - Reset counters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-29 +// - globalRulestackName - GlobalRulestack resource name +// - priority - Pre Rule priority +// - options - PreRulesClientResetCountersOptions contains the optional parameters for the PreRulesClient.ResetCounters method. +func (client *PreRulesClient) ResetCounters(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientResetCountersOptions) (PreRulesClientResetCountersResponse, error) { + req, err := client.resetCountersCreateRequest(ctx, globalRulestackName, priority, options) + if err != nil { + return PreRulesClientResetCountersResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PreRulesClientResetCountersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PreRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + } + return client.resetCountersHandleResponse(resp) +} + +// resetCountersCreateRequest creates the ResetCounters request. +func (client *PreRulesClient) resetCountersCreateRequest(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientResetCountersOptions) (*policy.Request, error) { + urlPath := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName}/preRules/{priority}/resetCounters" + if globalRulestackName == "" { + return nil, errors.New("parameter globalRulestackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{globalRulestackName}", url.PathEscape(globalRulestackName)) + if priority == "" { + return nil, errors.New("parameter priority cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{priority}", url.PathEscape(priority)) + 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-08-29") + if options != nil && options.FirewallName != nil { + reqQP.Set("firewallName", *options.FirewallName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// resetCountersHandleResponse handles the ResetCounters response. +func (client *PreRulesClient) resetCountersHandleResponse(resp *http.Response) (PreRulesClientResetCountersResponse, error) { + result := PreRulesClientResetCountersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RuleCounterReset); err != nil { + return PreRulesClientResetCountersResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go new file mode 100644 index 00000000..45565bcd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go @@ -0,0 +1,450 @@ +//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 armpanngfw + +// CertificateObjectGlobalRulestackClientCreateOrUpdateResponse contains the response from method CertificateObjectGlobalRulestackClient.BeginCreateOrUpdate. +type CertificateObjectGlobalRulestackClientCreateOrUpdateResponse struct { + CertificateObjectGlobalRulestackResource +} + +// CertificateObjectGlobalRulestackClientDeleteResponse contains the response from method CertificateObjectGlobalRulestackClient.BeginDelete. +type CertificateObjectGlobalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// CertificateObjectGlobalRulestackClientGetResponse contains the response from method CertificateObjectGlobalRulestackClient.Get. +type CertificateObjectGlobalRulestackClientGetResponse struct { + CertificateObjectGlobalRulestackResource +} + +// CertificateObjectGlobalRulestackClientListResponse contains the response from method CertificateObjectGlobalRulestackClient.NewListPager. +type CertificateObjectGlobalRulestackClientListResponse struct { + CertificateObjectGlobalRulestackResourceListResult +} + +// CertificateObjectLocalRulestackClientCreateOrUpdateResponse contains the response from method CertificateObjectLocalRulestackClient.BeginCreateOrUpdate. +type CertificateObjectLocalRulestackClientCreateOrUpdateResponse struct { + CertificateObjectLocalRulestackResource +} + +// CertificateObjectLocalRulestackClientDeleteResponse contains the response from method CertificateObjectLocalRulestackClient.BeginDelete. +type CertificateObjectLocalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// CertificateObjectLocalRulestackClientGetResponse contains the response from method CertificateObjectLocalRulestackClient.Get. +type CertificateObjectLocalRulestackClientGetResponse struct { + CertificateObjectLocalRulestackResource +} + +// CertificateObjectLocalRulestackClientListByLocalRulestacksResponse contains the response from method CertificateObjectLocalRulestackClient.NewListByLocalRulestacksPager. +type CertificateObjectLocalRulestackClientListByLocalRulestacksResponse struct { + CertificateObjectLocalRulestackResourceListResult +} + +// FirewallStatusClientGetResponse contains the response from method FirewallStatusClient.Get. +type FirewallStatusClientGetResponse struct { + FirewallStatusResource +} + +// FirewallStatusClientListByFirewallsResponse contains the response from method FirewallStatusClient.NewListByFirewallsPager. +type FirewallStatusClientListByFirewallsResponse struct { + FirewallStatusResourceListResult +} + +// FirewallsClientCreateOrUpdateResponse contains the response from method FirewallsClient.BeginCreateOrUpdate. +type FirewallsClientCreateOrUpdateResponse struct { + FirewallResource +} + +// FirewallsClientDeleteResponse contains the response from method FirewallsClient.BeginDelete. +type FirewallsClientDeleteResponse struct { + // placeholder for future response values +} + +// FirewallsClientGetGlobalRulestackResponse contains the response from method FirewallsClient.GetGlobalRulestack. +type FirewallsClientGetGlobalRulestackResponse struct { + GlobalRulestackInfo +} + +// FirewallsClientGetLogProfileResponse contains the response from method FirewallsClient.GetLogProfile. +type FirewallsClientGetLogProfileResponse struct { + LogSettings +} + +// FirewallsClientGetResponse contains the response from method FirewallsClient.Get. +type FirewallsClientGetResponse struct { + FirewallResource +} + +// FirewallsClientGetSupportInfoResponse contains the response from method FirewallsClient.GetSupportInfo. +type FirewallsClientGetSupportInfoResponse struct { + SupportInfo +} + +// FirewallsClientListByResourceGroupResponse contains the response from method FirewallsClient.NewListByResourceGroupPager. +type FirewallsClientListByResourceGroupResponse struct { + FirewallResourceListResult +} + +// FirewallsClientListBySubscriptionResponse contains the response from method FirewallsClient.NewListBySubscriptionPager. +type FirewallsClientListBySubscriptionResponse struct { + FirewallResourceListResult +} + +// FirewallsClientSaveLogProfileResponse contains the response from method FirewallsClient.SaveLogProfile. +type FirewallsClientSaveLogProfileResponse struct { + // placeholder for future response values +} + +// FirewallsClientUpdateResponse contains the response from method FirewallsClient.Update. +type FirewallsClientUpdateResponse struct { + FirewallResource +} + +// FqdnListGlobalRulestackClientCreateOrUpdateResponse contains the response from method FqdnListGlobalRulestackClient.BeginCreateOrUpdate. +type FqdnListGlobalRulestackClientCreateOrUpdateResponse struct { + FqdnListGlobalRulestackResource +} + +// FqdnListGlobalRulestackClientDeleteResponse contains the response from method FqdnListGlobalRulestackClient.BeginDelete. +type FqdnListGlobalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// FqdnListGlobalRulestackClientGetResponse contains the response from method FqdnListGlobalRulestackClient.Get. +type FqdnListGlobalRulestackClientGetResponse struct { + FqdnListGlobalRulestackResource +} + +// FqdnListGlobalRulestackClientListResponse contains the response from method FqdnListGlobalRulestackClient.NewListPager. +type FqdnListGlobalRulestackClientListResponse struct { + FqdnListGlobalRulestackResourceListResult +} + +// FqdnListLocalRulestackClientCreateOrUpdateResponse contains the response from method FqdnListLocalRulestackClient.BeginCreateOrUpdate. +type FqdnListLocalRulestackClientCreateOrUpdateResponse struct { + FqdnListLocalRulestackResource +} + +// FqdnListLocalRulestackClientDeleteResponse contains the response from method FqdnListLocalRulestackClient.BeginDelete. +type FqdnListLocalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// FqdnListLocalRulestackClientGetResponse contains the response from method FqdnListLocalRulestackClient.Get. +type FqdnListLocalRulestackClientGetResponse struct { + FqdnListLocalRulestackResource +} + +// FqdnListLocalRulestackClientListByLocalRulestacksResponse contains the response from method FqdnListLocalRulestackClient.NewListByLocalRulestacksPager. +type FqdnListLocalRulestackClientListByLocalRulestacksResponse struct { + FqdnListLocalRulestackResourceListResult +} + +// GlobalRulestackClientCommitResponse contains the response from method GlobalRulestackClient.BeginCommit. +type GlobalRulestackClientCommitResponse struct { + // placeholder for future response values +} + +// GlobalRulestackClientCreateOrUpdateResponse contains the response from method GlobalRulestackClient.BeginCreateOrUpdate. +type GlobalRulestackClientCreateOrUpdateResponse struct { + GlobalRulestackResource +} + +// GlobalRulestackClientDeleteResponse contains the response from method GlobalRulestackClient.BeginDelete. +type GlobalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// GlobalRulestackClientGetChangeLogResponse contains the response from method GlobalRulestackClient.GetChangeLog. +type GlobalRulestackClientGetChangeLogResponse struct { + Changelog +} + +// GlobalRulestackClientGetResponse contains the response from method GlobalRulestackClient.Get. +type GlobalRulestackClientGetResponse struct { + GlobalRulestackResource +} + +// GlobalRulestackClientListAdvancedSecurityObjectsResponse contains the response from method GlobalRulestackClient.ListAdvancedSecurityObjects. +type GlobalRulestackClientListAdvancedSecurityObjectsResponse struct { + AdvSecurityObjectListResponse +} + +// GlobalRulestackClientListAppIDsResponse contains the response from method GlobalRulestackClient.ListAppIDs. +type GlobalRulestackClientListAppIDsResponse struct { + ListAppIDResponse +} + +// GlobalRulestackClientListCountriesResponse contains the response from method GlobalRulestackClient.ListCountries. +type GlobalRulestackClientListCountriesResponse struct { + CountriesResponse +} + +// GlobalRulestackClientListFirewallsResponse contains the response from method GlobalRulestackClient.ListFirewalls. +type GlobalRulestackClientListFirewallsResponse struct { + ListFirewallsResponse +} + +// GlobalRulestackClientListPredefinedURLCategoriesResponse contains the response from method GlobalRulestackClient.ListPredefinedURLCategories. +type GlobalRulestackClientListPredefinedURLCategoriesResponse struct { + PredefinedURLCategoriesResponse +} + +// GlobalRulestackClientListResponse contains the response from method GlobalRulestackClient.NewListPager. +type GlobalRulestackClientListResponse struct { + GlobalRulestackResourceListResult +} + +// GlobalRulestackClientListSecurityServicesResponse contains the response from method GlobalRulestackClient.ListSecurityServices. +type GlobalRulestackClientListSecurityServicesResponse struct { + SecurityServicesResponse +} + +// GlobalRulestackClientRevertResponse contains the response from method GlobalRulestackClient.Revert. +type GlobalRulestackClientRevertResponse struct { + // placeholder for future response values +} + +// GlobalRulestackClientUpdateResponse contains the response from method GlobalRulestackClient.Update. +type GlobalRulestackClientUpdateResponse struct { + GlobalRulestackResource +} + +// LocalRulesClientCreateOrUpdateResponse contains the response from method LocalRulesClient.BeginCreateOrUpdate. +type LocalRulesClientCreateOrUpdateResponse struct { + LocalRulesResource +} + +// LocalRulesClientDeleteResponse contains the response from method LocalRulesClient.BeginDelete. +type LocalRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// LocalRulesClientGetCountersResponse contains the response from method LocalRulesClient.GetCounters. +type LocalRulesClientGetCountersResponse struct { + RuleCounter +} + +// LocalRulesClientGetResponse contains the response from method LocalRulesClient.Get. +type LocalRulesClientGetResponse struct { + LocalRulesResource +} + +// LocalRulesClientListByLocalRulestacksResponse contains the response from method LocalRulesClient.NewListByLocalRulestacksPager. +type LocalRulesClientListByLocalRulestacksResponse struct { + LocalRulesResourceListResult +} + +// LocalRulesClientRefreshCountersResponse contains the response from method LocalRulesClient.RefreshCounters. +type LocalRulesClientRefreshCountersResponse struct { + // placeholder for future response values +} + +// LocalRulesClientResetCountersResponse contains the response from method LocalRulesClient.ResetCounters. +type LocalRulesClientResetCountersResponse struct { + RuleCounterReset +} + +// LocalRulestacksClientCommitResponse contains the response from method LocalRulestacksClient.BeginCommit. +type LocalRulestacksClientCommitResponse struct { + // placeholder for future response values +} + +// LocalRulestacksClientCreateOrUpdateResponse contains the response from method LocalRulestacksClient.BeginCreateOrUpdate. +type LocalRulestacksClientCreateOrUpdateResponse struct { + LocalRulestackResource +} + +// LocalRulestacksClientDeleteResponse contains the response from method LocalRulestacksClient.BeginDelete. +type LocalRulestacksClientDeleteResponse struct { + // placeholder for future response values +} + +// LocalRulestacksClientGetChangeLogResponse contains the response from method LocalRulestacksClient.GetChangeLog. +type LocalRulestacksClientGetChangeLogResponse struct { + Changelog +} + +// LocalRulestacksClientGetResponse contains the response from method LocalRulestacksClient.Get. +type LocalRulestacksClientGetResponse struct { + LocalRulestackResource +} + +// LocalRulestacksClientGetSupportInfoResponse contains the response from method LocalRulestacksClient.GetSupportInfo. +type LocalRulestacksClientGetSupportInfoResponse struct { + SupportInfo +} + +// LocalRulestacksClientListAdvancedSecurityObjectsResponse contains the response from method LocalRulestacksClient.ListAdvancedSecurityObjects. +type LocalRulestacksClientListAdvancedSecurityObjectsResponse struct { + AdvSecurityObjectListResponse +} + +// LocalRulestacksClientListAppIDsResponse contains the response from method LocalRulestacksClient.ListAppIDs. +type LocalRulestacksClientListAppIDsResponse struct { + ListAppIDResponse +} + +// LocalRulestacksClientListByResourceGroupResponse contains the response from method LocalRulestacksClient.NewListByResourceGroupPager. +type LocalRulestacksClientListByResourceGroupResponse struct { + LocalRulestackResourceListResult +} + +// LocalRulestacksClientListBySubscriptionResponse contains the response from method LocalRulestacksClient.NewListBySubscriptionPager. +type LocalRulestacksClientListBySubscriptionResponse struct { + LocalRulestackResourceListResult +} + +// LocalRulestacksClientListCountriesResponse contains the response from method LocalRulestacksClient.ListCountries. +type LocalRulestacksClientListCountriesResponse struct { + CountriesResponse +} + +// LocalRulestacksClientListFirewallsResponse contains the response from method LocalRulestacksClient.ListFirewalls. +type LocalRulestacksClientListFirewallsResponse struct { + ListFirewallsResponse +} + +// LocalRulestacksClientListPredefinedURLCategoriesResponse contains the response from method LocalRulestacksClient.ListPredefinedURLCategories. +type LocalRulestacksClientListPredefinedURLCategoriesResponse struct { + PredefinedURLCategoriesResponse +} + +// LocalRulestacksClientListSecurityServicesResponse contains the response from method LocalRulestacksClient.ListSecurityServices. +type LocalRulestacksClientListSecurityServicesResponse struct { + SecurityServicesResponse +} + +// LocalRulestacksClientRevertResponse contains the response from method LocalRulestacksClient.Revert. +type LocalRulestacksClientRevertResponse struct { + // placeholder for future response values +} + +// LocalRulestacksClientUpdateResponse contains the response from method LocalRulestacksClient.Update. +type LocalRulestacksClientUpdateResponse struct { + LocalRulestackResource +} + +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + OperationListResult +} + +// PostRulesClientCreateOrUpdateResponse contains the response from method PostRulesClient.BeginCreateOrUpdate. +type PostRulesClientCreateOrUpdateResponse struct { + PostRulesResource +} + +// PostRulesClientDeleteResponse contains the response from method PostRulesClient.BeginDelete. +type PostRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// PostRulesClientGetCountersResponse contains the response from method PostRulesClient.GetCounters. +type PostRulesClientGetCountersResponse struct { + RuleCounter +} + +// PostRulesClientGetResponse contains the response from method PostRulesClient.Get. +type PostRulesClientGetResponse struct { + PostRulesResource +} + +// PostRulesClientListResponse contains the response from method PostRulesClient.NewListPager. +type PostRulesClientListResponse struct { + PostRulesResourceListResult +} + +// PostRulesClientRefreshCountersResponse contains the response from method PostRulesClient.RefreshCounters. +type PostRulesClientRefreshCountersResponse struct { + // placeholder for future response values +} + +// PostRulesClientResetCountersResponse contains the response from method PostRulesClient.ResetCounters. +type PostRulesClientResetCountersResponse struct { + RuleCounterReset +} + +// PreRulesClientCreateOrUpdateResponse contains the response from method PreRulesClient.BeginCreateOrUpdate. +type PreRulesClientCreateOrUpdateResponse struct { + PreRulesResource +} + +// PreRulesClientDeleteResponse contains the response from method PreRulesClient.BeginDelete. +type PreRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// PreRulesClientGetCountersResponse contains the response from method PreRulesClient.GetCounters. +type PreRulesClientGetCountersResponse struct { + RuleCounter +} + +// PreRulesClientGetResponse contains the response from method PreRulesClient.Get. +type PreRulesClientGetResponse struct { + PreRulesResource +} + +// PreRulesClientListResponse contains the response from method PreRulesClient.NewListPager. +type PreRulesClientListResponse struct { + PreRulesResourceListResult +} + +// PreRulesClientRefreshCountersResponse contains the response from method PreRulesClient.RefreshCounters. +type PreRulesClientRefreshCountersResponse struct { + // placeholder for future response values +} + +// PreRulesClientResetCountersResponse contains the response from method PreRulesClient.ResetCounters. +type PreRulesClientResetCountersResponse struct { + RuleCounterReset +} + +// PrefixListGlobalRulestackClientCreateOrUpdateResponse contains the response from method PrefixListGlobalRulestackClient.BeginCreateOrUpdate. +type PrefixListGlobalRulestackClientCreateOrUpdateResponse struct { + PrefixListGlobalRulestackResource +} + +// PrefixListGlobalRulestackClientDeleteResponse contains the response from method PrefixListGlobalRulestackClient.BeginDelete. +type PrefixListGlobalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// PrefixListGlobalRulestackClientGetResponse contains the response from method PrefixListGlobalRulestackClient.Get. +type PrefixListGlobalRulestackClientGetResponse struct { + PrefixListGlobalRulestackResource +} + +// PrefixListGlobalRulestackClientListResponse contains the response from method PrefixListGlobalRulestackClient.NewListPager. +type PrefixListGlobalRulestackClientListResponse struct { + PrefixListGlobalRulestackResourceListResult +} + +// PrefixListLocalRulestackClientCreateOrUpdateResponse contains the response from method PrefixListLocalRulestackClient.BeginCreateOrUpdate. +type PrefixListLocalRulestackClientCreateOrUpdateResponse struct { + PrefixListResource +} + +// PrefixListLocalRulestackClientDeleteResponse contains the response from method PrefixListLocalRulestackClient.BeginDelete. +type PrefixListLocalRulestackClientDeleteResponse struct { + // placeholder for future response values +} + +// PrefixListLocalRulestackClientGetResponse contains the response from method PrefixListLocalRulestackClient.Get. +type PrefixListLocalRulestackClientGetResponse struct { + PrefixListResource +} + +// PrefixListLocalRulestackClientListByLocalRulestacksResponse contains the response from method PrefixListLocalRulestackClient.NewListByLocalRulestacksPager. +type PrefixListLocalRulestackClientListByLocalRulestacksResponse struct { + PrefixListResourceListResult +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go new file mode 100644 index 00000000..b37eb223 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/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 armpanngfw + +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/magodo/aztft/internal/client/client.go b/vendor/github.com/magodo/aztft/internal/client/client.go index 3e8739c6..20e61322 100644 --- a/vendor/github.com/magodo/aztft/internal/client/client.go +++ b/vendor/github.com/magodo/aztft/internal/client/client.go @@ -28,6 +28,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeploymentscripts" @@ -597,3 +598,11 @@ func (b *ClientBuilder) NewLogicWorkflowsClient(subscriptionId string) (*armlogi &b.ClientOpt, ) } + +func (b *ClientBuilder) NewPaloalToNetworkFirewallsClient(subscriptionId string) (*armpanngfw.FirewallsClient, error) { + return armpanngfw.NewFirewallsClient( + subscriptionId, + b.Cred, + &b.ClientOpt, + ) +} diff --git a/vendor/github.com/magodo/aztft/internal/resmap/map.json b/vendor/github.com/magodo/aztft/internal/resmap/map.json index 9d26837d..debb15ca 100644 --- a/vendor/github.com/magodo/aztft/internal/resmap/map.json +++ b/vendor/github.com/magodo/aztft/internal/resmap/map.json @@ -175,7 +175,7 @@ "policies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/operations/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/operations" ] } }, @@ -208,7 +208,7 @@ "policies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis" ] } }, @@ -668,7 +668,7 @@ "policies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service" ] } }, @@ -731,7 +731,7 @@ "policies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/products/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/products" ] } }, @@ -1323,12 +1323,12 @@ "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.HyrbidCompute", + "provider": "Microsoft.HybridCompute", "types": [ "privateLinkScopes" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.HyrbidCompute/privateLinkScopes" + "/subscriptions/resourceGroups/Microsoft.HybridCompute/privateLinkScopes" ] } }, @@ -1675,6 +1675,21 @@ ] } }, + "azurerm_automation_variable_object": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Automation", + "types": [ + "automationAccounts", + "variables" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Automation/automationAccounts/variables" + ] + } + }, "azurerm_automation_variable_string": { "management_plane": { "scopes": [ @@ -3174,6 +3189,20 @@ ] } }, + "azurerm_custom_ip_prefix": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Network", + "types": [ + "customIPPrefixes" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Network/customIPPrefixes" + ] + } + }, "azurerm_custom_provider": { "management_plane": { "scopes": [ @@ -4254,6 +4283,22 @@ ] } }, + "azurerm_databricks_workspace_root_dbfs_customer_managed_key": { + "is_removed": true, + "remove_reason": "This is a property rather than a resource", + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Databricks", + "types": [ + "workspaces" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Databricks/workspaces" + ] + } + }, "azurerm_datadog_monitor": { "management_plane": { "scopes": [ @@ -5402,6 +5447,22 @@ } }, "azurerm_graph_account": { + "is_removed": true, + "remove_reason": "This is deprecated in favor of `azurerm_graph_service_account`", + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.GraphServices", + "types": [ + "accounts" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.GraphServices/accounts" + ] + } + }, + "azurerm_graph_services_account": { "management_plane": { "scopes": [ "/subscriptions/resourceGroups" @@ -6296,6 +6357,21 @@ ] } }, + "azurerm_kubernetes_cluster_trusted_access_role_binding": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.ContainerService", + "types": [ + "managedClusters", + "trustedAccessRoleBindings" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings" + ] + } + }, "azurerm_kubernetes_fleet_manager": { "management_plane": { "scopes": [ @@ -7554,6 +7630,20 @@ ] } }, + "azurerm_managed_lustre_file_system": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.StorageCache", + "types": [ + "amlFilesystems" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.StorageCache/amlFilesystems" + ] + } + }, "azurerm_management_group": { "management_plane": { "provider": "Microsoft.Management", @@ -7751,6 +7841,20 @@ ] } }, + "azurerm_marketplace_role_assignment": { + "management_plane": { + "scopes": [ + "/Microsoft.Marketplace" + ], + "provider": "Microsoft.Authorization", + "types": [ + "roleAssignments" + ], + "import_specs": [ + "/Microsoft.Marketplace/Microsoft.Authorization/roleAssignments" + ] + } + }, "azurerm_media_asset": { "management_plane": { "scopes": [ @@ -8022,6 +8126,21 @@ ] } }, + "azurerm_mobile_network_sim": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.MobileNetwork", + "types": [ + "simGroups", + "sims" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.MobileNetwork/simGroups/sims" + ] + } + }, "azurerm_mobile_network_sim_group": { "management_plane": { "scopes": [ @@ -8755,6 +8874,35 @@ ] } }, + "azurerm_mssql_virtual_machine_availability_group_listener": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.SqlVirtualMachine", + "types": [ + "sqlVirtualMachineGroups", + "availabilityGroupListeners" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners" + ] + } + }, + "azurerm_mssql_virtual_machine_group": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.SqlVirtualMachine", + "types": [ + "sqlVirtualMachineGroups" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups" + ] + } + }, "azurerm_mssql_virtual_network_rule": { "management_plane": { "scopes": [ @@ -9107,6 +9255,20 @@ ] } }, + "azurerm_network_function_azure_traffic_collector": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.NetworkFunction", + "types": [ + "azureTrafficCollectors" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.NetworkFunction/azureTrafficCollectors" + ] + } + }, "azurerm_network_interface": { "management_plane": { "scopes": [ @@ -9615,6 +9777,150 @@ ] } }, + "azurerm_palo_alto_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks" + ] + } + }, + "azurerm_palo_alto_local_rulestack_certificate": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "certificates" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/certificates" + ] + } + }, + "azurerm_palo_alto_local_rulestack_fqdn_list": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "fqdnLists" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/fqdnLists" + ] + } + }, + "azurerm_palo_alto_local_rulestack_prefix_list": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "prefixLists" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/prefixLists" + ] + } + }, + "azurerm_palo_alto_local_rulestack_rule": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "localRules" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/localRules" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_hub_panorama": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_virtual_network_appliance": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Network", + "types": [ + "networkVirtualAppliances" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Network/networkVirtualAppliances" + ] + } + }, "azurerm_point_to_site_vpn_gateway": { "management_plane": { "scopes": [ @@ -10520,6 +10826,18 @@ ] } }, + "azurerm_resource_provider_registration": { + "management_plane": { + "scopes": [ + "/subscriptions" + ], + "provider": "Microsoft.PolicyInsights", + "types": [], + "import_specs": [ + "/subscriptions/Microsoft.PolicyInsights" + ] + } + }, "azurerm_role_assignment": { "management_plane": { "scopes": [ @@ -14404,10 +14722,10 @@ ], "provider": "Microsoft.Network", "types": [ - "ApplicationGatewayWebApplicationFirewallPolicies" + "applicationGatewayWebApplicationFirewallPolicies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" + "/subscriptions/resourceGroups/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies" ] } }, diff --git a/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json b/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json index d0858ac2..7b70a231 100644 --- a/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json +++ b/vendor/github.com/magodo/aztft/internal/resmap/map_gen.json @@ -170,11 +170,10 @@ "types": [ "service", "apis", - "operations", - "policies" + "operations" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/operations/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/operations" ] } }, @@ -203,11 +202,10 @@ "provider": "Microsoft.ApiManagement", "types": [ "service", - "apis", - "policies" + "apis" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/apis" ] } }, @@ -663,11 +661,10 @@ ], "provider": "Microsoft.ApiManagement", "types": [ - "service", - "policies" + "service" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service" ] } }, @@ -726,11 +723,10 @@ "provider": "Microsoft.ApiManagement", "types": [ "service", - "products", - "policies" + "products" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/products/policies" + "/subscriptions/resourceGroups/Microsoft.ApiManagement/service/products" ] } }, @@ -1310,12 +1306,12 @@ "scopes": [ "/subscriptions/resourceGroups" ], - "provider": "Microsoft.HyrbidCompute", + "provider": "Microsoft.HybridCompute", "types": [ "privateLinkScopes" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.HyrbidCompute/privateLinkScopes" + "/subscriptions/resourceGroups/Microsoft.HybridCompute/privateLinkScopes" ] } }, @@ -1662,6 +1658,21 @@ ] } }, + "azurerm_automation_variable_object": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Automation", + "types": [ + "automationAccounts", + "variables" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Automation/automationAccounts/variables" + ] + } + }, "azurerm_automation_variable_string": { "management_plane": { "scopes": [ @@ -3157,6 +3168,20 @@ ] } }, + "azurerm_custom_ip_prefix": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Network", + "types": [ + "customIPPrefixes" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Network/customIPPrefixes" + ] + } + }, "azurerm_custom_provider": { "management_plane": { "scopes": [ @@ -4229,6 +4254,20 @@ ] } }, + "azurerm_databricks_workspace_root_dbfs_customer_managed_key": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Databricks", + "types": [ + "workspaces" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Databricks/workspaces" + ] + } + }, "azurerm_datadog_monitor": { "management_plane": { "scopes": [ @@ -5360,6 +5399,20 @@ ] } }, + "azurerm_graph_services_account": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.GraphServices", + "types": [ + "accounts" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.GraphServices/accounts" + ] + } + }, "azurerm_hdinsight_hadoop_cluster": { "management_plane": { "scopes": [ @@ -6233,6 +6286,21 @@ ] } }, + "azurerm_kubernetes_cluster_trusted_access_role_binding": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.ContainerService", + "types": [ + "managedClusters", + "trustedAccessRoleBindings" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings" + ] + } + }, "azurerm_kubernetes_fleet_manager": { "management_plane": { "scopes": [ @@ -7483,6 +7551,20 @@ ] } }, + "azurerm_managed_lustre_file_system": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.StorageCache", + "types": [ + "amlFilesystems" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.StorageCache/amlFilesystems" + ] + } + }, "azurerm_management_group": { "management_plane": { "provider": "Microsoft.Management", @@ -7683,6 +7765,20 @@ ] } }, + "azurerm_marketplace_role_assignment": { + "management_plane": { + "scopes": [ + "/Microsoft.Marketplace" + ], + "provider": "Microsoft.Authorization", + "types": [ + "roleAssignments" + ], + "import_specs": [ + "/Microsoft.Marketplace/Microsoft.Authorization/roleAssignments" + ] + } + }, "azurerm_media_asset": { "management_plane": { "scopes": [ @@ -7954,6 +8050,21 @@ ] } }, + "azurerm_mobile_network_sim": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.MobileNetwork", + "types": [ + "simGroups", + "sims" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.MobileNetwork/simGroups/sims" + ] + } + }, "azurerm_mobile_network_sim_group": { "management_plane": { "scopes": [ @@ -8681,6 +8792,35 @@ ] } }, + "azurerm_mssql_virtual_machine_availability_group_listener": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.SqlVirtualMachine", + "types": [ + "sqlVirtualMachineGroups", + "availabilityGroupListeners" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners" + ] + } + }, + "azurerm_mssql_virtual_machine_group": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.SqlVirtualMachine", + "types": [ + "sqlVirtualMachineGroups" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups" + ] + } + }, "azurerm_mssql_virtual_network_rule": { "management_plane": { "scopes": [ @@ -9009,6 +9149,20 @@ ] } }, + "azurerm_network_function_azure_traffic_collector": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.NetworkFunction", + "types": [ + "azureTrafficCollectors" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.NetworkFunction/azureTrafficCollectors" + ] + } + }, "azurerm_network_interface": { "management_plane": { "scopes": [ @@ -9085,6 +9239,22 @@ ] } }, + "azurerm_network_manager_deployment": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Network", + "types": [ + "networkManagers", + "locations", + "types" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Network/networkManagers" + ] + } + }, "azurerm_network_manager_management_group_connection": { "management_plane": { "scopes": [ @@ -9421,6 +9591,150 @@ ] } }, + "azurerm_palo_alto_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks" + ] + } + }, + "azurerm_palo_alto_local_rulestack_certificate": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "certificates" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/certificates" + ] + } + }, + "azurerm_palo_alto_local_rulestack_fqdn_list": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "fqdnLists" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/fqdnLists" + ] + } + }, + "azurerm_palo_alto_local_rulestack_prefix_list": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "prefixLists" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/prefixLists" + ] + } + }, + "azurerm_palo_alto_local_rulestack_rule": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "localRulestacks", + "localRules" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/localRulestacks/localRules" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_hub_panorama": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "PaloAltoNetworks.Cloudngfw", + "types": [ + "firewalls" + ], + "import_specs": [ + "/subscriptions/resourceGroups/PaloAltoNetworks.Cloudngfw/firewalls" + ] + } + }, + "azurerm_palo_alto_virtual_network_appliance": { + "management_plane": { + "scopes": [ + "/subscriptions/resourceGroups" + ], + "provider": "Microsoft.Network", + "types": [ + "networkVirtualAppliances" + ], + "import_specs": [ + "/subscriptions/resourceGroups/Microsoft.Network/networkVirtualAppliances" + ] + } + }, "azurerm_point_to_site_vpn_gateway": { "management_plane": { "scopes": [ @@ -10331,6 +10645,18 @@ ] } }, + "azurerm_resource_provider_registration": { + "management_plane": { + "scopes": [ + "/subscriptions" + ], + "provider": "Microsoft.PolicyInsights", + "types": [], + "import_specs": [ + "/subscriptions/Microsoft.PolicyInsights" + ] + } + }, "azurerm_role_assignment": { "management_plane": { "scopes": [ @@ -14178,10 +14504,10 @@ ], "provider": "Microsoft.Network", "types": [ - "ApplicationGatewayWebApplicationFirewallPolicies" + "applicationGatewayWebApplicationFirewallPolicies" ], "import_specs": [ - "/subscriptions/resourceGroups/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" + "/subscriptions/resourceGroups/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies" ] } }, diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve.go index cd8a6c43..4cebe397 100644 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve.go +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve.go @@ -190,6 +190,9 @@ var Resolvers = map[string]map[string]resolver{ "/MICROSOFT.LOGIC/WORKFLOWS/TRIGGERS": { "/SUBSCRIPTIONS/RESOURCEGROUPS": logicAppTrigger{}, }, + "/PALOALTONETWORKS.CLOUDNGFW/FIREWALLS": { + "/SUBSCRIPTIONS/RESOURCEGROUPS": paloalToNetworkFirewall{}, + }, } type ResolveError struct { diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_automation_variable.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_automation_variable.go index 3d47225a..a911a98c 100644 --- a/vendor/github.com/magodo/aztft/internal/resolve/resolve_automation_variable.go +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve_automation_variable.go @@ -6,6 +6,8 @@ import ( "regexp" "strconv" + "encoding/json" + "github.com/magodo/armid" "github.com/magodo/aztft/internal/client" ) @@ -18,6 +20,7 @@ func (automationVariablesResolver) ResourceTypes() []string { "azurerm_automation_variable_string", "azurerm_automation_variable_bool", "azurerm_automation_variable_int", + "azurerm_automation_variable_object", } } @@ -57,5 +60,10 @@ func (automationVariablesResolver) Resolve(b *client.ClientBuilder, id armid.Res if _, err = strconv.ParseBool(*value); err == nil { return "azurerm_automation_variable_bool", nil } + + var object interface{} + if json.Unmarshal([]byte(*value), &object) == nil { + return "azurerm_automation_variable_object", nil + } return "", fmt.Errorf("can't resolve resource type from value: %q", *value) } diff --git a/vendor/github.com/magodo/aztft/internal/resolve/resolve_paloal_to_network_firewall.go b/vendor/github.com/magodo/aztft/internal/resolve/resolve_paloal_to_network_firewall.go new file mode 100644 index 00000000..fc1cd2a5 --- /dev/null +++ b/vendor/github.com/magodo/aztft/internal/resolve/resolve_paloal_to_network_firewall.go @@ -0,0 +1,66 @@ +package resolve + +import ( + "context" + "fmt" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" + "github.com/magodo/armid" + "github.com/magodo/aztft/internal/client" +) + +type paloalToNetworkFirewall struct{} + +func (paloalToNetworkFirewall) ResourceTypes() []string { + return []string{ + "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama", + "azurerm_palo_alto_next_generation_firewall_virtual_hub_panorama", + "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack", + "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack", + } +} + +func (paloalToNetworkFirewall) Resolve(b *client.ClientBuilder, id armid.ResourceId) (string, error) { + resourceGroupId := id.RootScope().(*armid.ResourceGroup) + client, err := b.NewPaloalToNetworkFirewallsClient(resourceGroupId.SubscriptionId) + if err != nil { + return "", err + } + resp, err := client.Get(context.Background(), resourceGroupId.Name, id.Names()[0], nil) + if err != nil { + return "", fmt.Errorf("retrieving %q: %v", id, err) + } + props := resp.FirewallResource.Properties + if props == nil { + return "", fmt.Errorf("unexpected nil property in response") + } + + if props.NetworkProfile == nil { + return "", fmt.Errorf("unexpected nil networkProfile in response") + } + if props.NetworkProfile.NetworkType == nil { + return "", fmt.Errorf("unexpected nil networkProfile.networkType in response") + } + + networkType := *props.NetworkProfile.NetworkType + + if props.IsPanoramaManaged != nil && *props.IsPanoramaManaged == armpanngfw.BooleanEnumTRUE { + switch networkType { + case armpanngfw.NetworkTypeVNET: + return "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama", nil + case armpanngfw.NetworkTypeVWAN: + return "azurerm_palo_alto_next_generation_firewall_vhub_panorama", nil + default: + return "", fmt.Errorf("unknown network type: %s", networkType) + } + } else { + switch networkType { + case armpanngfw.NetworkTypeVNET: + return "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack", nil + case armpanngfw.NetworkTypeVWAN: + return "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack", nil + default: + return "", fmt.Errorf("unknown network type: %s", networkType) + } + } +} diff --git a/vendor/github.com/magodo/aztft/internal/tfid/tfid.go b/vendor/github.com/magodo/aztft/internal/tfid/tfid.go index ed299e53..91782ae0 100644 --- a/vendor/github.com/magodo/aztft/internal/tfid/tfid.go +++ b/vendor/github.com/magodo/aztft/internal/tfid/tfid.go @@ -119,13 +119,20 @@ func StaticBuild(id armid.ResourceId, rt string) (string, error) { return "", fmt.Errorf("normalizing id %q for %q with import spec %q: %v", pid.String(), rt, importSpec, err) } return pid.String(), nil + case "azurerm_role_definition": + scopeId := id.Parent() + if scopeId == nil { + scopeId = id.ParentScope() + } + scopePart := scopeId.String() + routePart := strings.TrimPrefix(id.String(), scopePart) + return routePart + "|" + scopePart, nil case "azurerm_network_manager_deployment": managerId := id.Parent().Parent() if err := managerId.Normalize(importSpec); err != nil { return "", fmt.Errorf("normalizing id %q for %q with import spec %q: %v", managerId.String(), rt, importSpec, err) } return managerId.String() + "/commit|" + id.Names()[1] + "|" + id.Names()[2], nil - // Porperty-like resources case "azurerm_disk_pool_iscsi_target_lun": return buildIdForPropertyLikeResource(id.Parent(), lastItem(id.Names()), "azurerm_disk_pool_iscsi_target", "azurerm_managed_disk", "/lun|") @@ -151,6 +158,15 @@ func StaticBuild(id armid.ResourceId, rt string) (string, error) { "azurerm_subnet_network_security_group_association", "azurerm_subnet_route_table_association": return id.Parent().String(), nil + case "azurerm_api_management_api_operation_policy", + "azurerm_api_management_api_policy", + "azurerm_api_management_policy", + "azurerm_api_management_product_policy": + pid := id.Parent() + if err := pid.Normalize(importSpec); err != nil { + return "", fmt.Errorf("normalizing id %q for %q with import spec %q: %v", pid.String(), rt, importSpec, err) + } + return pid.String(), nil } if importSpec != "" { diff --git a/vendor/modules.txt b/vendor/modules.txt index c8b486d3..1a4bfa9b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -108,6 +108,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights v1.1.1 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights +# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw v1.0.0 +## explicit; go 1.18 +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup v1.0.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup @@ -265,7 +268,7 @@ github.com/imdario/mergo # github.com/magodo/armid v0.0.0-20230511151020-27880e5961c3 ## explicit; go 1.18 github.com/magodo/armid -# github.com/magodo/aztft v0.3.1-0.20230721030203-db4a4bcab2b3 +# github.com/magodo/aztft v0.3.1-0.20230825031936-c246852b4337 ## explicit; go 1.19 github.com/magodo/aztft/aztft github.com/magodo/aztft/internal/client