From 302420289d55ab7aa49f1f54712e3468e1244921 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 23 Oct 2023 06:55:42 +0000 Subject: [PATCH] CodeGen from PR 26338 in Azure/azure-rest-api-specs Merge 6ac49f9e32632f62dcc53e30c2c31f3dc683ef97 into e1a87e1a5deb3f986ea1474d233d6680f1e19fc1 --- .../armpanngfw/CHANGELOG.md | 12 + .../armpanngfw/autorest.md | 7 +- ...certificateobjectglobalrulestack_client.go | 65 +- ...jectglobalrulestack_client_example_test.go | 299 --- .../certificateobjectlocalrulestack_client.go | 65 +- ...bjectlocalrulestack_client_example_test.go | 299 --- .../armpanngfw/client_factory.go | 51 +- .../armpanngfw/constants.go | 5 +- .../armpanngfw/firewalls_client.go | 151 +- .../firewalls_client_example_test.go | 1734 ----------------- .../armpanngfw/firewallstatus_client.go | 22 +- .../firewallstatus_client_example_test.go | 170 -- .../fqdnlistglobalrulestack_client.go | 65 +- ...listglobalrulestack_client_example_test.go | 311 --- .../fqdnlistlocalrulestack_client.go | 65 +- ...nlistlocalrulestack_client_example_test.go | 311 --- .../armpanngfw/globalrulestack_client.go | 221 ++- .../globalrulestack_client_example_test.go | 987 ---------- .../paloaltonetworksngfw/armpanngfw/go.mod | 16 +- .../paloaltonetworksngfw/armpanngfw/go.sum | 26 +- .../armpanngfw/localrules_client.go | 107 +- .../localrules_client_example_test.go | 629 ------ .../armpanngfw/localrulestacks_client.go | 270 ++- .../localrulestacks_client_example_test.go | 1171 ----------- .../paloaltonetworksngfw/armpanngfw/models.go | 531 +---- .../armpanngfw/models_serde.go | 7 +- .../armpanngfw/operations_client.go | 7 +- .../operations_client_example_test.go | 85 - .../armpanngfw/options.go | 535 +++++ .../armpanngfw/postrules_client.go | 107 +- .../postrules_client_example_test.go | 629 ------ .../prefixlistglobalrulestack_client.go | 65 +- ...listglobalrulestack_client_example_test.go | 303 --- .../prefixlistlocalrulestack_client.go | 65 +- ...xlistlocalrulestack_client_example_test.go | 303 --- .../armpanngfw/prerules_client.go | 107 +- .../prerules_client_example_test.go | 629 ------ .../armpanngfw/response_types.go | 75 +- .../armpanngfw/time_rfc3339.go | 3 +- 39 files changed, 1440 insertions(+), 9070 deletions(-) delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client_example_test.go create mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/options.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client_example_test.go delete mode 100644 sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client_example_test.go diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md index 887cde9f6758..e8cf997bf672 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 2.0.0 (2023-10-23) +### Breaking Changes + +- Function `*LocalRulestacksClient.ListAppIDs` has been removed +- Function `*LocalRulestacksClient.ListCountries` has been removed +- Function `*LocalRulestacksClient.ListPredefinedURLCategories` has been removed + +### Features Added + +- New field `TrustedRanges` in struct `NetworkProfile` + + ## 1.0.0 (2023-07-14) ### Other Changes diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md index 2725d4b3ea08..83c7ca330849 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/autorest.md @@ -5,9 +5,8 @@ ``` 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 +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/paloaltonetworks/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/paloaltonetworks/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2022-08-29 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go index d5f2ac89e69f..18e1ebaab831 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -44,7 +43,7 @@ func NewCertificateObjectGlobalRulestackClient(credential azcore.TokenCredential // BeginCreateOrUpdate - Create a CertificateObjectGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - certificate name // - resource - Resource create parameters. @@ -56,9 +55,10 @@ func (client *CertificateObjectGlobalRulestackClient) BeginCreateOrUpdate(ctx co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificateObjectGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -67,20 +67,22 @@ func (client *CertificateObjectGlobalRulestackClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Create a CertificateObjectGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *CertificateObjectGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource CertificateObjectGlobalRulestackResource, options *CertificateObjectGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,16 +101,19 @@ func (client *CertificateObjectGlobalRulestackClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a CertificateObjectGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - certificate name // - options - CertificateObjectGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.BeginDelete @@ -119,9 +124,10 @@ func (client *CertificateObjectGlobalRulestackClient) BeginDelete(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectGlobalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificateObjectGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -130,20 +136,22 @@ func (client *CertificateObjectGlobalRulestackClient) BeginDelete(ctx context.Co // Delete - Delete a CertificateObjectGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *CertificateObjectGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *CertificateObjectGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -162,7 +170,7 @@ func (client *CertificateObjectGlobalRulestackClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,24 +179,27 @@ func (client *CertificateObjectGlobalRulestackClient) deleteCreateRequest(ctx co // Get - Get a CertificateObjectGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return CertificateObjectGlobalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateObjectGlobalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificateObjectGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificateObjectGlobalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -207,7 +218,7 @@ func (client *CertificateObjectGlobalRulestackClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +235,7 @@ func (client *CertificateObjectGlobalRulestackClient) getHandleResponse(resp *ht // NewListPager - List CertificateObjectGlobalRulestackResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - options - CertificateObjectGlobalRulestackClientListOptions contains the optional parameters for the CertificateObjectGlobalRulestackClient.NewListPager // method. @@ -268,7 +279,7 @@ func (client *CertificateObjectGlobalRulestackClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client_example_test.go deleted file mode 100644 index 5bee8844cc65..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectglobalrulestack_client_example_test.go +++ /dev/null @@ -1,299 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_List_MaximumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_NewListPager_certificateObjectGlobalRulestackListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateObjectGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateObjectGlobalRulestackResourceListResult = armpanngfw.CertificateObjectGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.CertificateObjectGlobalRulestackResource{ - // { - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("desc"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_List_MinimumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_NewListPager_certificateObjectGlobalRulestackListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateObjectGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateObjectGlobalRulestackResourceListResult = armpanngfw.CertificateObjectGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.CertificateObjectGlobalRulestackResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/certificates/certificates1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_Get_MaximumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_Get_certificateObjectGlobalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateObjectGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectGlobalRulestackResource = armpanngfw.CertificateObjectGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("description"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_Get_MinimumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_Get_certificateObjectGlobalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateObjectGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectGlobalRulestackResource = armpanngfw.CertificateObjectGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/certificates/armid1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_BeginCreateOrUpdate_certificateObjectGlobalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.CertificateObjectGlobalRulestackResource{ - Properties: &armpanngfw.CertificateObject{ - Description: to.Ptr("description"), - AuditComment: to.Ptr("comment"), - CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - CertificateSignerResourceID: to.Ptr(""), - Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectGlobalRulestackResource = armpanngfw.CertificateObjectGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("description"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_BeginCreateOrUpdate_certificateObjectGlobalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.CertificateObjectGlobalRulestackResource{ - Properties: &armpanngfw.CertificateObject{ - CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectGlobalRulestackResource = armpanngfw.CertificateObjectGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/certificates/armid1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_Delete_MaximumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_BeginDelete_certificateObjectGlobalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectGlobalRulestack_Delete_MinimumSet_Gen.json -func ExampleCertificateObjectGlobalRulestackClient_BeginDelete_certificateObjectGlobalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go index ac6a57f38189..03e0761a390d 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,7 +46,7 @@ func NewCertificateObjectLocalRulestackClient(subscriptionID string, credential // BeginCreateOrUpdate - Create a CertificateObjectLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - certificate name @@ -60,9 +59,10 @@ func (client *CertificateObjectLocalRulestackClient) BeginCreateOrUpdate(ctx con if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificateObjectLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *CertificateObjectLocalRulestackClient) BeginCreateOrUpdate(ctx con // CreateOrUpdate - Create a CertificateObjectLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *CertificateObjectLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource CertificateObjectLocalRulestackResource, options *CertificateObjectLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ func (client *CertificateObjectLocalRulestackClient) createOrUpdateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a CertificateObjectLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - certificate name @@ -132,9 +137,10 @@ func (client *CertificateObjectLocalRulestackClient) BeginDelete(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificateObjectLocalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificateObjectLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ func (client *CertificateObjectLocalRulestackClient) BeginDelete(ctx context.Con // Delete - Delete a CertificateObjectLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *CertificateObjectLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *CertificateObjectLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -183,7 +191,7 @@ func (client *CertificateObjectLocalRulestackClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,25 +200,28 @@ func (client *CertificateObjectLocalRulestackClient) deleteCreateRequest(ctx con // Get - Get a CertificateObjectLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return CertificateObjectLocalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateObjectLocalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificateObjectLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificateObjectLocalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,7 @@ func (client *CertificateObjectLocalRulestackClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,7 @@ func (client *CertificateObjectLocalRulestackClient) getHandleResponse(resp *htt // NewListByLocalRulestacksPager - List CertificateObjectLocalRulestackResource resources by LocalRulestacks // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -307,7 +318,7 @@ func (client *CertificateObjectLocalRulestackClient) listByLocalRulestacksCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client_example_test.go deleted file mode 100644 index 460d8daff0ba..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/certificateobjectlocalrulestack_client_example_test.go +++ /dev/null @@ -1,299 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_NewListByLocalRulestacksPager_certificateObjectLocalRulestackListByLocalRulestacksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateObjectLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateObjectLocalRulestackResourceListResult = armpanngfw.CertificateObjectLocalRulestackResourceListResult{ - // Value: []*armpanngfw.CertificateObjectLocalRulestackResource{ - // { - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/lrs1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("desc"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_NewListByLocalRulestacksPager_certificateObjectLocalRulestackListByLocalRulestacksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateObjectLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateObjectLocalRulestackResourceListResult = armpanngfw.CertificateObjectLocalRulestackResourceListResult{ - // Value: []*armpanngfw.CertificateObjectLocalRulestackResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/certificates/certificates1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_Get_MaximumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_Get_certificateObjectLocalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateObjectLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectLocalRulestackResource = armpanngfw.CertificateObjectLocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/lrs1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("description"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_Get_MinimumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_Get_certificateObjectLocalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateObjectLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectLocalRulestackResource = armpanngfw.CertificateObjectLocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/certificates/armid1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_BeginCreateOrUpdate_certificateObjectLocalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.CertificateObjectLocalRulestackResource{ - Properties: &armpanngfw.CertificateObject{ - Description: to.Ptr("description"), - AuditComment: to.Ptr("comment"), - CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - CertificateSignerResourceID: to.Ptr(""), - Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectLocalRulestackResource = armpanngfw.CertificateObjectLocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/lrs1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.CertificateObject{ - // Description: to.Ptr("description"), - // AuditComment: to.Ptr("comment"), - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // CertificateSignerResourceID: to.Ptr(""), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_BeginCreateOrUpdate_certificateObjectLocalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.CertificateObjectLocalRulestackResource{ - Properties: &armpanngfw.CertificateObject{ - CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateObjectLocalRulestackResource = armpanngfw.CertificateObjectLocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/lrs1/certificates/armid1"), - // Properties: &armpanngfw.CertificateObject{ - // CertificateSelfSigned: to.Ptr(armpanngfw.BooleanEnumTRUE), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_Delete_MaximumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_BeginDelete_certificateObjectLocalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/CertificateObjectLocalRulestack_Delete_MinimumSet_Gen.json -func ExampleCertificateObjectLocalRulestackClient_BeginDelete_certificateObjectLocalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateObjectLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go index f6fe0e8300d8..88819f802481 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -38,43 +37,43 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewGlobalRulestackClient() *GlobalRulestackClient { - subClient, _ := NewGlobalRulestackClient(c.credential, c.options) +func (c *ClientFactory) NewCertificateObjectGlobalRulestackClient() *CertificateObjectGlobalRulestackClient { + subClient, _ := NewCertificateObjectGlobalRulestackClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewCertificateObjectGlobalRulestackClient() *CertificateObjectGlobalRulestackClient { - subClient, _ := NewCertificateObjectGlobalRulestackClient(c.credential, c.options) +func (c *ClientFactory) NewCertificateObjectLocalRulestackClient() *CertificateObjectLocalRulestackClient { + subClient, _ := NewCertificateObjectLocalRulestackClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewFqdnListGlobalRulestackClient() *FqdnListGlobalRulestackClient { - subClient, _ := NewFqdnListGlobalRulestackClient(c.credential, c.options) +func (c *ClientFactory) NewFirewallStatusClient() *FirewallStatusClient { + subClient, _ := NewFirewallStatusClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPostRulesClient() *PostRulesClient { - subClient, _ := NewPostRulesClient(c.credential, c.options) +func (c *ClientFactory) NewFirewallsClient() *FirewallsClient { + subClient, _ := NewFirewallsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrefixListGlobalRulestackClient() *PrefixListGlobalRulestackClient { - subClient, _ := NewPrefixListGlobalRulestackClient(c.credential, c.options) +func (c *ClientFactory) NewFqdnListGlobalRulestackClient() *FqdnListGlobalRulestackClient { + subClient, _ := NewFqdnListGlobalRulestackClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewPreRulesClient() *PreRulesClient { - subClient, _ := NewPreRulesClient(c.credential, c.options) +func (c *ClientFactory) NewFqdnListLocalRulestackClient() *FqdnListLocalRulestackClient { + subClient, _ := NewFqdnListLocalRulestackClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewGlobalRulestackClient() *GlobalRulestackClient { + subClient, _ := NewGlobalRulestackClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewFirewallsClient() *FirewallsClient { - subClient, _ := NewFirewallsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewLocalRulesClient() *LocalRulesClient { + subClient, _ := NewLocalRulesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -83,23 +82,23 @@ func (c *ClientFactory) NewLocalRulestacksClient() *LocalRulestacksClient { return subClient } -func (c *ClientFactory) NewFirewallStatusClient() *FirewallStatusClient { - subClient, _ := NewFirewallStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewCertificateObjectLocalRulestackClient() *CertificateObjectLocalRulestackClient { - subClient, _ := NewCertificateObjectLocalRulestackClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPostRulesClient() *PostRulesClient { + subClient, _ := NewPostRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewFqdnListLocalRulestackClient() *FqdnListLocalRulestackClient { - subClient, _ := NewFqdnListLocalRulestackClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPreRulesClient() *PreRulesClient { + subClient, _ := NewPreRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewLocalRulesClient() *LocalRulesClient { - subClient, _ := NewLocalRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrefixListGlobalRulestackClient() *PrefixListGlobalRulestackClient { + subClient, _ := NewPrefixListGlobalRulestackClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go index 1df73b4d30a9..b7495190137a 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw const ( moduleName = "armpanngfw" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) type ActionEnum string diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go index 2621a4056184..f6e9bc77ccfb 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,7 +46,7 @@ func NewFirewallsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Create a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - firewallName - Firewall resource name // - resource - Resource create parameters. @@ -59,9 +58,10 @@ func (client *FirewallsClient) BeginCreateOrUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FirewallsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *FirewallsClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Create a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FirewallsClient) createOrUpdate(ctx context.Context, resourceGroupName string, firewallName string, resource FirewallResource, options *FirewallsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, firewallName, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -106,16 +108,19 @@ func (client *FirewallsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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. @@ -125,9 +130,10 @@ func (client *FirewallsClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FirewallsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FirewallsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,20 +142,22 @@ func (client *FirewallsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallName string, options *FirewallsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -172,7 +180,7 @@ func (client *FirewallsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,23 +189,26 @@ func (client *FirewallsClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -220,7 +231,7 @@ func (client *FirewallsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,24 +249,27 @@ func (client *FirewallsClient) getHandleResponse(resp *http.Response) (Firewalls // 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 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getGlobalRulestackCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallsClientGetGlobalRulestackResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientGetGlobalRulestackResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallsClientGetGlobalRulestackResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientGetGlobalRulestackResponse{}, err } - return client.getGlobalRulestackHandleResponse(resp) + resp, err := client.getGlobalRulestackHandleResponse(httpResp) + return resp, err } // getGlobalRulestackCreateRequest creates the GetGlobalRulestack request. @@ -278,7 +292,7 @@ func (client *FirewallsClient) getGlobalRulestackCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,23 +310,26 @@ func (client *FirewallsClient) getGlobalRulestackHandleResponse(resp *http.Respo // GetLogProfile - Log Profile for Firewall // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getLogProfileCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallsClientGetLogProfileResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientGetLogProfileResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallsClientGetLogProfileResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientGetLogProfileResponse{}, err } - return client.getLogProfileHandleResponse(resp) + resp, err := client.getLogProfileHandleResponse(httpResp) + return resp, err } // getLogProfileCreateRequest creates the GetLogProfile request. @@ -335,7 +352,7 @@ func (client *FirewallsClient) getLogProfileCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,24 +370,27 @@ func (client *FirewallsClient) getLogProfileHandleResponse(resp *http.Response) // GetSupportInfo - support info for firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getSupportInfoCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallsClientGetSupportInfoResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientGetSupportInfoResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallsClientGetSupportInfoResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientGetSupportInfoResponse{}, err } - return client.getSupportInfoHandleResponse(resp) + resp, err := client.getSupportInfoHandleResponse(httpResp) + return resp, err } // getSupportInfoCreateRequest creates the GetSupportInfo request. @@ -393,7 +413,7 @@ func (client *FirewallsClient) getSupportInfoCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Email != nil { reqQP.Set("email", *options.Email) } @@ -413,7 +433,7 @@ func (client *FirewallsClient) getSupportInfoHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List FirewallResource resources by resource group // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - FirewallsClientListByResourceGroupOptions contains the optional parameters for the FirewallsClient.NewListByResourceGroupPager // method. @@ -461,7 +481,7 @@ func (client *FirewallsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -478,7 +498,7 @@ func (client *FirewallsClient) listByResourceGroupHandleResponse(resp *http.Resp // NewListBySubscriptionPager - List FirewallResource resources by subscription ID // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - options - FirewallsClientListBySubscriptionOptions contains the optional parameters for the FirewallsClient.NewListBySubscriptionPager // method. func (client *FirewallsClient) NewListBySubscriptionPager(options *FirewallsClientListBySubscriptionOptions) *runtime.Pager[FirewallsClientListBySubscriptionResponse] { @@ -521,7 +541,7 @@ func (client *FirewallsClient) listBySubscriptionCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -539,22 +559,24 @@ func (client *FirewallsClient) listBySubscriptionHandleResponse(resp *http.Respo // SaveLogProfile - Log Profile for Firewall // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.saveLogProfileCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallsClientSaveLogProfileResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientSaveLogProfileResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return FirewallsClientSaveLogProfileResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientSaveLogProfileResponse{}, err } return FirewallsClientSaveLogProfileResponse{}, nil } @@ -579,11 +601,14 @@ func (client *FirewallsClient) saveLogProfileCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") 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) + if err := runtime.MarshalAsJSON(req, *options.LogSettings); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -591,24 +616,27 @@ func (client *FirewallsClient) saveLogProfileCreateRequest(ctx context.Context, // Update - Update a FirewallResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, firewallName, properties, options) if err != nil { return FirewallsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -631,10 +659,13 @@ func (client *FirewallsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client_example_test.go deleted file mode 100644 index 5724f4ed9779..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewalls_client_example_test.go +++ /dev/null @@ -1,1734 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_ListBySubscription_MaximumSet_Gen.json -func ExampleFirewallsClient_NewListBySubscriptionPager_firewallsListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallResourceListResult = armpanngfw.FirewallResourceListResult{ - // Value: []*armpanngfw.FirewallResource{ - // { - // Name: to.Ptr("armid1"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/firewalls/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // AssociatedRulestack: &armpanngfw.RulestackDetails{ - // Location: to.Ptr("eastus"), - // ResourceID: to.Ptr("aaaaaaaaaa"), - // RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - // }, - // DNSSettings: &armpanngfw.DNSSettings{ - // DNSServers: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - // EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - // }, - // FrontEndSettings: []*armpanngfw.FrontendSetting{ - // { - // Name: to.Ptr("frontendsetting11"), - // BackendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.32.136"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - // }, - // Port: to.Ptr("80"), - // }, - // FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.91.251"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - // }, - // Port: to.Ptr("80"), - // }, - // Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - // }}, - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // MarketplaceSubscriptionID: to.Ptr("aa"), - // MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EgressNatIP: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // VnetConfiguration: &armpanngfw.VnetConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // Vnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.0.0/16"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - // }, - // }, - // VwanConfiguration: &armpanngfw.VwanConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // VHub: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // }, - // }, - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanoramaConfig: &armpanngfw.PanoramaConfig{ - // CgName: to.Ptr("PanoramaCollectorGroup"), - // ConfigString: to.Ptr("bas64EncodedString"), - // DgName: to.Ptr("PanoramaDeviceGroup"), - // HostName: to.Ptr("hostname"), - // PanoramaServer: to.Ptr("10.25.1.1"), - // PanoramaServer2: to.Ptr("10.20.1.1"), - // TplName: to.Ptr("PanoramaTemplateStack"), - // VMAuthKey: to.Ptr("SSH_AUTH_KEY"), - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-13T00:46:05.283Z"); return t}()), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_ListBySubscription_MinimumSet_Gen.json -func ExampleFirewallsClient_NewListBySubscriptionPager_firewallsListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallResourceListResult = armpanngfw.FirewallResourceListResult{ - // Value: []*armpanngfw.FirewallResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/firewalls/armid1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // DNSSettings: &armpanngfw.DNSSettings{ - // }, - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_ListByResourceGroup_MaximumSet_Gen.json -func ExampleFirewallsClient_NewListByResourceGroupPager_firewallsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallsClient().NewListByResourceGroupPager("firewall-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallResourceListResult = armpanngfw.FirewallResourceListResult{ - // Value: []*armpanngfw.FirewallResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // AssociatedRulestack: &armpanngfw.RulestackDetails{ - // Location: to.Ptr("eastus"), - // ResourceID: to.Ptr("aaaaaaaaaa"), - // RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - // }, - // DNSSettings: &armpanngfw.DNSSettings{ - // DNSServers: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - // EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - // }, - // FrontEndSettings: []*armpanngfw.FrontendSetting{ - // { - // Name: to.Ptr("frontendsetting11"), - // BackendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.32.136"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - // }, - // Port: to.Ptr("80"), - // }, - // FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.91.251"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - // }, - // Port: to.Ptr("80"), - // }, - // Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - // }}, - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // MarketplaceSubscriptionID: to.Ptr("aa"), - // MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EgressNatIP: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // VnetConfiguration: &armpanngfw.VnetConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // Vnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.0.0/16"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - // }, - // }, - // VwanConfiguration: &armpanngfw.VwanConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // VHub: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // }, - // }, - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanoramaConfig: &armpanngfw.PanoramaConfig{ - // CgName: to.Ptr("PanoramaCollectorGroup"), - // ConfigString: to.Ptr("bas64EncodedString"), - // DgName: to.Ptr("PanoramaDeviceGroup"), - // HostName: to.Ptr("hostname"), - // PanoramaServer: to.Ptr("10.25.1.1"), - // PanoramaServer2: to.Ptr("10.20.1.1"), - // TplName: to.Ptr("PanoramaTemplateStack"), - // VMAuthKey: to.Ptr("SSH_AUTH_KEY"), - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-13T00:46:05.283Z"); return t}()), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_ListByResourceGroup_MinimumSet_Gen.json -func ExampleFirewallsClient_NewListByResourceGroupPager_firewallsListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallsClient().NewListByResourceGroupPager("firewall-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallResourceListResult = armpanngfw.FirewallResourceListResult{ - // Value: []*armpanngfw.FirewallResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // DNSSettings: &armpanngfw.DNSSettings{ - // }, - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Get_MaximumSet_Gen.json -func ExampleFirewallsClient_Get_firewallsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().Get(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/firewalls/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // AssociatedRulestack: &armpanngfw.RulestackDetails{ - // Location: to.Ptr("eastus"), - // ResourceID: to.Ptr("aaaaaaaaaa"), - // RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - // }, - // DNSSettings: &armpanngfw.DNSSettings{ - // DNSServers: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - // EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - // }, - // FrontEndSettings: []*armpanngfw.FrontendSetting{ - // { - // Name: to.Ptr("frontendsetting11"), - // BackendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.32.136"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - // }, - // Port: to.Ptr("80"), - // }, - // FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.91.251"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - // }, - // Port: to.Ptr("80"), - // }, - // Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - // }}, - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // MarketplaceSubscriptionID: to.Ptr("aa"), - // MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EgressNatIP: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // VnetConfiguration: &armpanngfw.VnetConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // Vnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.0.0/16"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - // }, - // }, - // VwanConfiguration: &armpanngfw.VwanConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // VHub: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // }, - // }, - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanoramaConfig: &armpanngfw.PanoramaConfig{ - // CgName: to.Ptr("PanoramaCollectorGroup"), - // ConfigString: to.Ptr("bas64EncodedString"), - // DgName: to.Ptr("PanoramaDeviceGroup"), - // HostName: to.Ptr("hostname"), - // PanoramaServer: to.Ptr("10.25.1.1"), - // PanoramaServer2: to.Ptr("10.20.1.1"), - // TplName: to.Ptr("PanoramaTemplateStack"), - // VMAuthKey: to.Ptr("SSH_AUTH_KEY"), - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-13T00:46:05.283Z"); return t}()), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Get_MinimumSet_Gen.json -func ExampleFirewallsClient_Get_firewallsGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().Get(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // DNSSettings: &armpanngfw.DNSSettings{ - // }, - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_CreateOrUpdate_MaximumSet_Gen.json -func ExampleFirewallsClient_BeginCreateOrUpdate_firewallsCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallsClient().BeginCreateOrUpdate(ctx, "firewall-rg", "firewall1", armpanngfw.FirewallResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagName": to.Ptr("value"), - }, - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Properties: &armpanngfw.FirewallDeploymentProperties{ - AssociatedRulestack: &armpanngfw.RulestackDetails{ - Location: to.Ptr("eastus"), - ResourceID: to.Ptr("lrs1"), - RulestackID: to.Ptr("PANRSID"), - }, - DNSSettings: &armpanngfw.DNSSettings{ - DNSServers: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.111"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - }}, - EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - }, - FrontEndSettings: []*armpanngfw.FrontendSetting{ - { - Name: to.Ptr("frontendsetting11"), - BackendConfiguration: &armpanngfw.EndpointConfiguration{ - Address: &armpanngfw.IPAddress{ - Address: to.Ptr("20.22.32.136"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - }, - Port: to.Ptr("80"), - }, - FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - Address: &armpanngfw.IPAddress{ - Address: to.Ptr("20.22.91.251"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - }, - Port: to.Ptr("80"), - }, - Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - }}, - IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - OfferID: to.Ptr("liftr-pan-ame-test"), - PublisherID: to.Ptr("isvtestuklegacy"), - }, - NetworkProfile: &armpanngfw.NetworkProfile{ - EgressNatIP: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.111"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - }}, - EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - PublicIPs: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.11"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - }}, - VnetConfiguration: &armpanngfw.VnetConfiguration{ - IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - Address: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - TrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - }, - UnTrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - Vnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.0.0/16"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - }, - }, - VwanConfiguration: &armpanngfw.VwanConfiguration{ - IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - Address: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - TrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - }, - UnTrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - VHub: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - }, - }, - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanoramaConfig: &armpanngfw.PanoramaConfig{ - ConfigString: to.Ptr("bas64EncodedString"), - }, - PlanData: &armpanngfw.PlanData{ - BillingCycle: to.Ptr(armpanngfw.BillingCycleMONTHLY), - PlanID: to.Ptr("liftrpantestplan"), - UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - }, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("firewalls"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/firewalls/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // AssociatedRulestack: &armpanngfw.RulestackDetails{ - // Location: to.Ptr("eastus"), - // ResourceID: to.Ptr("aaaaaaaaaa"), - // RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - // }, - // DNSSettings: &armpanngfw.DNSSettings{ - // DNSServers: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - // EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - // }, - // FrontEndSettings: []*armpanngfw.FrontendSetting{ - // { - // Name: to.Ptr("frontendsetting11"), - // BackendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.32.136"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - // }, - // Port: to.Ptr("80"), - // }, - // FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.91.251"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - // }, - // Port: to.Ptr("80"), - // }, - // Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - // }}, - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // MarketplaceSubscriptionID: to.Ptr("aa"), - // MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EgressNatIP: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // VnetConfiguration: &armpanngfw.VnetConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // Vnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.0.0/16"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - // }, - // }, - // VwanConfiguration: &armpanngfw.VwanConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // VHub: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // }, - // }, - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanoramaConfig: &armpanngfw.PanoramaConfig{ - // CgName: to.Ptr("PanoramaCollectorGroup"), - // ConfigString: to.Ptr("bas64EncodedString"), - // DgName: to.Ptr("PanoramaDeviceGroup"), - // HostName: to.Ptr("hostname"), - // PanoramaServer: to.Ptr("10.25.1.1"), - // PanoramaServer2: to.Ptr("10.20.1.1"), - // TplName: to.Ptr("PanoramaTemplateStack"), - // VMAuthKey: to.Ptr("SSH_AUTH_KEY"), - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-13T00:46:05.283Z"); return t}()), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_CreateOrUpdate_MinimumSet_Gen.json -func ExampleFirewallsClient_BeginCreateOrUpdate_firewallsCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallsClient().BeginCreateOrUpdate(ctx, "firewall-rg", "firewall1", armpanngfw.FirewallResource{ - Location: to.Ptr("eastus"), - Properties: &armpanngfw.FirewallDeploymentProperties{ - DNSSettings: &armpanngfw.DNSSettings{}, - MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - OfferID: to.Ptr("liftr-pan-ame-test"), - PublisherID: to.Ptr("isvtestuklegacy"), - }, - NetworkProfile: &armpanngfw.NetworkProfile{ - EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - PublicIPs: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.11"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - }}, - }, - PlanData: &armpanngfw.PlanData{ - BillingCycle: to.Ptr(armpanngfw.BillingCycleMONTHLY), - PlanID: to.Ptr("liftrpantestplan"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // DNSSettings: &armpanngfw.DNSSettings{ - // }, - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Update_MaximumSet_Gen.json -func ExampleFirewallsClient_Update_firewallsUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().Update(ctx, "firewall-rg", "firewall1", armpanngfw.FirewallResourceUpdate{ - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Properties: &armpanngfw.FirewallResourceUpdateProperties{ - AssociatedRulestack: &armpanngfw.RulestackDetails{ - Location: to.Ptr("eastus"), - ResourceID: to.Ptr("aaaaaaaaaa"), - RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - }, - DNSSettings: &armpanngfw.DNSSettings{ - DNSServers: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.111"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - }}, - EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - }, - FrontEndSettings: []*armpanngfw.FrontendSetting{ - { - Name: to.Ptr("frontendsetting11"), - BackendConfiguration: &armpanngfw.EndpointConfiguration{ - Address: &armpanngfw.IPAddress{ - Address: to.Ptr("20.22.32.136"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - }, - Port: to.Ptr("80"), - }, - FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - Address: &armpanngfw.IPAddress{ - Address: to.Ptr("20.22.91.251"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - }, - Port: to.Ptr("80"), - }, - Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - }}, - IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - PublisherID: to.Ptr("aaaa"), - }, - NetworkProfile: &armpanngfw.NetworkProfile{ - EgressNatIP: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.111"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - }}, - EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - PublicIPs: []*armpanngfw.IPAddress{ - { - Address: to.Ptr("20.22.92.11"), - ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - }}, - VnetConfiguration: &armpanngfw.VnetConfiguration{ - IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - Address: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - TrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - }, - UnTrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - Vnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.0.0/16"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - }, - }, - VwanConfiguration: &armpanngfw.VwanConfiguration{ - IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - Address: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - TrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - }, - UnTrustSubnet: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - VHub: &armpanngfw.IPAddressSpace{ - AddressSpace: to.Ptr("10.1.1.0/24"), - ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - }, - }, - }, - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanoramaConfig: &armpanngfw.PanoramaConfig{ - ConfigString: to.Ptr("bas64EncodedString"), - }, - PlanData: &armpanngfw.PlanData{ - BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - }, - }, - Tags: map[string]*string{ - "tagName": to.Ptr("value"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/acctest4136/providers/PaloAltoNetworks.Cloudngfw/firewalls/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // AssociatedRulestack: &armpanngfw.RulestackDetails{ - // Location: to.Ptr("eastus"), - // ResourceID: to.Ptr("aaaaaaaaaa"), - // RulestackID: to.Ptr("aaaaaaaaaaaaaaaa"), - // }, - // DNSSettings: &armpanngfw.DNSSettings{ - // DNSServers: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableDNSProxy: to.Ptr(armpanngfw.DNSProxyDISABLED), - // EnabledDNSType: to.Ptr(armpanngfw.EnabledDNSTypeCUSTOM), - // }, - // FrontEndSettings: []*armpanngfw.FrontendSetting{ - // { - // Name: to.Ptr("frontendsetting11"), - // BackendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.32.136"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2"), - // }, - // Port: to.Ptr("80"), - // }, - // FrontendConfiguration: &armpanngfw.EndpointConfiguration{ - // Address: &armpanngfw.IPAddress{ - // Address: to.Ptr("20.22.91.251"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1"), - // }, - // Port: to.Ptr("80"), - // }, - // Protocol: to.Ptr(armpanngfw.ProtocolTypeTCP), - // }}, - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // MarketplaceSubscriptionID: to.Ptr("aa"), - // MarketplaceSubscriptionStatus: to.Ptr(armpanngfw.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EgressNatIP: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.111"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1"), - // }}, - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // VnetConfiguration: &armpanngfw.VnetConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // Vnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.0.0/16"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet"), - // }, - // }, - // VwanConfiguration: &armpanngfw.VwanConfiguration{ - // IPOfTrustSubnetForUdr: &armpanngfw.IPAddress{ - // Address: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // NetworkVirtualApplianceID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // TrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet"), - // }, - // UnTrustSubnet: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // VHub: &armpanngfw.IPAddressSpace{ - // AddressSpace: to.Ptr("10.1.1.0/24"), - // ResourceID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet"), - // }, - // }, - // }, - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanoramaConfig: &armpanngfw.PanoramaConfig{ - // CgName: to.Ptr("PanoramaCollectorGroup"), - // ConfigString: to.Ptr("bas64EncodedString"), - // DgName: to.Ptr("PanoramaDeviceGroup"), - // HostName: to.Ptr("hostname"), - // PanoramaServer: to.Ptr("10.25.1.1"), - // PanoramaServer2: to.Ptr("10.20.1.1"), - // TplName: to.Ptr("PanoramaTemplateStack"), - // VMAuthKey: to.Ptr("SSH_AUTH_KEY"), - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-13T00:46:05.283Z"); return t}()), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UsageType: to.Ptr(armpanngfw.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Update_MinimumSet_Gen.json -func ExampleFirewallsClient_Update_firewallsUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().Update(ctx, "firewall-rg", "firewall1", armpanngfw.FirewallResourceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallResource = armpanngfw.FirewallResource{ - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.FirewallDeploymentProperties{ - // DNSSettings: &armpanngfw.DNSSettings{ - // }, - // MarketplaceDetails: &armpanngfw.MarketplaceDetails{ - // OfferID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PublisherID: to.Ptr("aaaa"), - // }, - // NetworkProfile: &armpanngfw.NetworkProfile{ - // EnableEgressNat: to.Ptr(armpanngfw.EgressNatENABLED), - // NetworkType: to.Ptr(armpanngfw.NetworkTypeVNET), - // PublicIPs: []*armpanngfw.IPAddress{ - // { - // Address: to.Ptr("20.22.92.11"), - // ResourceID: to.Ptr("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1"), - // }}, - // }, - // PlanData: &armpanngfw.PlanData{ - // BillingCycle: to.Ptr(armpanngfw.BillingCycleWEEKLY), - // PlanID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Delete_MaximumSet_Gen.json -func ExampleFirewallsClient_BeginDelete_firewallsDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallsClient().BeginDelete(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_Delete_MinimumSet_Gen.json -func ExampleFirewallsClient_BeginDelete_firewallsDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallsClient().BeginDelete(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getGlobalRulestack_MaximumSet_Gen.json -func ExampleFirewallsClient_GetGlobalRulestack_firewallsGetGlobalRulestackMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetGlobalRulestack(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackInfo = armpanngfw.GlobalRulestackInfo{ - // AzureID: to.Ptr("aaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getGlobalRulestack_MinimumSet_Gen.json -func ExampleFirewallsClient_GetGlobalRulestack_firewallsGetGlobalRulestackMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetGlobalRulestack(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackInfo = armpanngfw.GlobalRulestackInfo{ - // AzureID: to.Ptr("aaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getLogProfile_MaximumSet_Gen.json -func ExampleFirewallsClient_GetLogProfile_firewallsGetLogProfileMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetLogProfile(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogSettings = armpanngfw.LogSettings{ - // ApplicationInsights: &armpanngfw.ApplicationInsights{ - // ID: to.Ptr("aaaaaaaaaaaaaaaa"), - // Key: to.Ptr("aaaaaaaaaaaaa"), - // }, - // CommonDestination: &armpanngfw.LogDestination{ - // EventHubConfigurations: &armpanngfw.EventHub{ - // Name: to.Ptr("aaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PolicyName: to.Ptr("aaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaaa"), - // }, - // MonitorConfigurations: &armpanngfw.MonitorLog{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - // SecondaryKey: to.Ptr("a"), - // SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - // Workspace: to.Ptr("aaaaaaaaaaa"), - // }, - // StorageConfigurations: &armpanngfw.StorageAccount{ - // AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaa"), - // }, - // }, - // DecryptLogDestination: &armpanngfw.LogDestination{ - // EventHubConfigurations: &armpanngfw.EventHub{ - // Name: to.Ptr("aaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PolicyName: to.Ptr("aaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaaa"), - // }, - // MonitorConfigurations: &armpanngfw.MonitorLog{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - // SecondaryKey: to.Ptr("a"), - // SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - // Workspace: to.Ptr("aaaaaaaaaaa"), - // }, - // StorageConfigurations: &armpanngfw.StorageAccount{ - // AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaa"), - // }, - // }, - // LogOption: to.Ptr(armpanngfw.LogOptionSAMEDESTINATION), - // LogType: to.Ptr(armpanngfw.LogTypeTRAFFIC), - // ThreatLogDestination: &armpanngfw.LogDestination{ - // EventHubConfigurations: &armpanngfw.EventHub{ - // Name: to.Ptr("aaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PolicyName: to.Ptr("aaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaaa"), - // }, - // MonitorConfigurations: &armpanngfw.MonitorLog{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - // SecondaryKey: to.Ptr("a"), - // SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - // Workspace: to.Ptr("aaaaaaaaaaa"), - // }, - // StorageConfigurations: &armpanngfw.StorageAccount{ - // AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaa"), - // }, - // }, - // TrafficLogDestination: &armpanngfw.LogDestination{ - // EventHubConfigurations: &armpanngfw.EventHub{ - // Name: to.Ptr("aaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PolicyName: to.Ptr("aaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaaa"), - // }, - // MonitorConfigurations: &armpanngfw.MonitorLog{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - // SecondaryKey: to.Ptr("a"), - // SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - // Workspace: to.Ptr("aaaaaaaaaaa"), - // }, - // StorageConfigurations: &armpanngfw.StorageAccount{ - // AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaa"), - // SubscriptionID: to.Ptr("aaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getLogProfile_MinimumSet_Gen.json -func ExampleFirewallsClient_GetLogProfile_firewallsGetLogProfileMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetLogProfile(ctx, "firewall-rg", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogSettings = armpanngfw.LogSettings{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getSupportInfo_MaximumSet_Gen.json -func ExampleFirewallsClient_GetSupportInfo_firewallsGetSupportInfoMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetSupportInfo(ctx, "rgopenapi", "firewall1", &armpanngfw.FirewallsClientGetSupportInfoOptions{Email: to.Ptr("user1@domain.com")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportInfo = armpanngfw.SupportInfo{ - // AccountID: to.Ptr("3cg5b439-294d-4c25-b0b2-ef649e0g6d38"), - // AccountRegistered: to.Ptr(armpanngfw.BooleanEnumTRUE), - // FreeTrial: to.Ptr(armpanngfw.BooleanEnumTRUE), - // FreeTrialCreditLeft: to.Ptr[int32](10), - // FreeTrialDaysLeft: to.Ptr[int32](1), - // HelpURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // ProductSerial: to.Ptr("e22715cb-7e4e-4814-ad4f-ccd1417755d7"), - // ProductSKU: to.Ptr("62f63e3c-bc5a-4d68-a8a1-fcba9f526c90"), - // RegisterURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // SupportURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // UserDomainSupported: to.Ptr(armpanngfw.BooleanEnumTRUE), - // UserRegistered: to.Ptr(armpanngfw.BooleanEnumTRUE), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_getSupportInfo_MinimumSet_Gen.json -func ExampleFirewallsClient_GetSupportInfo_firewallsGetSupportInfoMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallsClient().GetSupportInfo(ctx, "rgopenapi", "firewall1", &armpanngfw.FirewallsClientGetSupportInfoOptions{Email: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportInfo = armpanngfw.SupportInfo{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_saveLogProfile_MaximumSet_Gen.json -func ExampleFirewallsClient_SaveLogProfile_firewallsSaveLogProfileMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallsClient().SaveLogProfile(ctx, "firewall-rg", "firewall1", &armpanngfw.FirewallsClientSaveLogProfileOptions{LogSettings: &armpanngfw.LogSettings{ - ApplicationInsights: &armpanngfw.ApplicationInsights{ - ID: to.Ptr("aaaaaaaaaaaaaaaa"), - Key: to.Ptr("aaaaaaaaaaaaa"), - }, - CommonDestination: &armpanngfw.LogDestination{ - EventHubConfigurations: &armpanngfw.EventHub{ - Name: to.Ptr("aaaaaaaa"), - ID: to.Ptr("aaaaaaaaaa"), - NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - PolicyName: to.Ptr("aaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaaa"), - }, - MonitorConfigurations: &armpanngfw.MonitorLog{ - ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - SecondaryKey: to.Ptr("a"), - SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - Workspace: to.Ptr("aaaaaaaaaaa"), - }, - StorageConfigurations: &armpanngfw.StorageAccount{ - AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - ID: to.Ptr("aaaaaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaa"), - }, - }, - DecryptLogDestination: &armpanngfw.LogDestination{ - EventHubConfigurations: &armpanngfw.EventHub{ - Name: to.Ptr("aaaaaaaa"), - ID: to.Ptr("aaaaaaaaaa"), - NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - PolicyName: to.Ptr("aaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaaa"), - }, - MonitorConfigurations: &armpanngfw.MonitorLog{ - ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - SecondaryKey: to.Ptr("a"), - SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - Workspace: to.Ptr("aaaaaaaaaaa"), - }, - StorageConfigurations: &armpanngfw.StorageAccount{ - AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - ID: to.Ptr("aaaaaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaa"), - }, - }, - LogOption: to.Ptr(armpanngfw.LogOptionSAMEDESTINATION), - LogType: to.Ptr(armpanngfw.LogTypeTRAFFIC), - ThreatLogDestination: &armpanngfw.LogDestination{ - EventHubConfigurations: &armpanngfw.EventHub{ - Name: to.Ptr("aaaaaaaa"), - ID: to.Ptr("aaaaaaaaaa"), - NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - PolicyName: to.Ptr("aaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaaa"), - }, - MonitorConfigurations: &armpanngfw.MonitorLog{ - ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - SecondaryKey: to.Ptr("a"), - SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - Workspace: to.Ptr("aaaaaaaaaaa"), - }, - StorageConfigurations: &armpanngfw.StorageAccount{ - AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - ID: to.Ptr("aaaaaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaa"), - }, - }, - TrafficLogDestination: &armpanngfw.LogDestination{ - EventHubConfigurations: &armpanngfw.EventHub{ - Name: to.Ptr("aaaaaaaa"), - ID: to.Ptr("aaaaaaaaaa"), - NameSpace: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - PolicyName: to.Ptr("aaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaaa"), - }, - MonitorConfigurations: &armpanngfw.MonitorLog{ - ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - PrimaryKey: to.Ptr("aaaaaaaaaaaaa"), - SecondaryKey: to.Ptr("a"), - SubscriptionID: to.Ptr("aaaaaaaaaaaaa"), - Workspace: to.Ptr("aaaaaaaaaaa"), - }, - StorageConfigurations: &armpanngfw.StorageAccount{ - AccountName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - ID: to.Ptr("aaaaaaaaaaaaaaa"), - SubscriptionID: to.Ptr("aaaaaaaaa"), - }, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Firewalls_saveLogProfile_MinimumSet_Gen.json -func ExampleFirewallsClient_SaveLogProfile_firewallsSaveLogProfileMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallsClient().SaveLogProfile(ctx, "firewall-rg", "firewall1", &armpanngfw.FirewallsClientSaveLogProfileOptions{LogSettings: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go index f272d1047694..3698ef7256d3 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,23 +46,26 @@ func NewFirewallStatusClient(subscriptionID string, credential azcore.TokenCrede // Get - Get a FirewallStatusResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, firewallName, options) if err != nil { return FirewallStatusClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FirewallStatusClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FirewallStatusClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FirewallStatusClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -86,7 +88,7 @@ func (client *FirewallStatusClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,7 +105,7 @@ func (client *FirewallStatusClient) getHandleResponse(resp *http.Response) (Fire // NewListByFirewallsPager - List FirewallStatusResource resources by Firewalls // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -156,7 +158,7 @@ func (client *FirewallStatusClient) listByFirewallsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client_example_test.go deleted file mode 100644 index 62b11141875d..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/firewallstatus_client_example_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FirewallStatus_ListByFirewalls_MaximumSet_Gen.json -func ExampleFirewallStatusClient_NewListByFirewallsPager_firewallStatusListByFirewallsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallStatusClient().NewListByFirewallsPager("rgopenapi", "firewall1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallStatusResourceListResult = armpanngfw.FirewallStatusResourceListResult{ - // Value: []*armpanngfw.FirewallStatusResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("aaaaaaa"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1/statuses/default"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FirewallStatusProperty{ - // HealthReason: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // HealthStatus: to.Ptr(armpanngfw.HealthStatusGREEN), - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // PanoramaStatus: &armpanngfw.PanoramaStatus{ - // PanoramaServer2Status: to.Ptr(armpanngfw.ServerStatusUP), - // PanoramaServerStatus: to.Ptr(armpanngfw.ServerStatusUP), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ReadOnlyProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FirewallStatus_ListByFirewalls_MinimumSet_Gen.json -func ExampleFirewallStatusClient_NewListByFirewallsPager_firewallStatusListByFirewallsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallStatusClient().NewListByFirewallsPager("rgopenapi", "firewall1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FirewallStatusResourceListResult = armpanngfw.FirewallStatusResourceListResult{ - // Value: []*armpanngfw.FirewallStatusResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1/statuses/default"), - // Properties: &armpanngfw.FirewallStatusProperty{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FirewallStatus_Get_MaximumSet_Gen.json -func ExampleFirewallStatusClient_Get_firewallStatusGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallStatusClient().Get(ctx, "rgopenapi", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallStatusResource = armpanngfw.FirewallStatusResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1/statuses/default"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FirewallStatusProperty{ - // HealthReason: to.Ptr("aaaaaaaaaaaa"), - // HealthStatus: to.Ptr(armpanngfw.HealthStatusGREEN), - // IsPanoramaManaged: to.Ptr(armpanngfw.BooleanEnumTRUE), - // PanoramaStatus: &armpanngfw.PanoramaStatus{ - // PanoramaServer2Status: to.Ptr(armpanngfw.ServerStatusUP), - // PanoramaServerStatus: to.Ptr(armpanngfw.ServerStatusUP), - // }, - // ProvisioningState: to.Ptr(armpanngfw.ReadOnlyProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FirewallStatus_Get_MinimumSet_Gen.json -func ExampleFirewallStatusClient_Get_firewallStatusGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallStatusClient().Get(ctx, "rgopenapi", "firewall1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FirewallStatusResource = armpanngfw.FirewallStatusResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/firewalls/firewall1/statuses/default"), - // Properties: &armpanngfw.FirewallStatusProperty{ - // }, - // } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go index 96a1f7e7959e..f7135b79d1f7 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -44,7 +43,7 @@ func NewFqdnListGlobalRulestackClient(credential azcore.TokenCredential, options // BeginCreateOrUpdate - Create a FqdnListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - fqdn list name // - resource - Resource create parameters. @@ -56,9 +55,10 @@ func (client *FqdnListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FqdnListGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -67,20 +67,22 @@ func (client *FqdnListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create a FqdnListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FqdnListGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource FqdnListGlobalRulestackResource, options *FqdnListGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,16 +101,19 @@ func (client *FqdnListGlobalRulestackClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a FqdnListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - fqdn list name // - options - FqdnListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the FqdnListGlobalRulestackClient.BeginDelete @@ -119,9 +124,10 @@ func (client *FqdnListGlobalRulestackClient) BeginDelete(ctx context.Context, gl if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListGlobalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FqdnListGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -130,20 +136,22 @@ func (client *FqdnListGlobalRulestackClient) BeginDelete(ctx context.Context, gl // Delete - Delete a FqdnListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FqdnListGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *FqdnListGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -162,7 +170,7 @@ func (client *FqdnListGlobalRulestackClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,24 +179,27 @@ func (client *FqdnListGlobalRulestackClient) deleteCreateRequest(ctx context.Con // Get - Get a FqdnListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return FqdnListGlobalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FqdnListGlobalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FqdnListGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FqdnListGlobalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -207,7 +218,7 @@ func (client *FqdnListGlobalRulestackClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +235,7 @@ func (client *FqdnListGlobalRulestackClient) getHandleResponse(resp *http.Respon // NewListPager - List FqdnListGlobalRulestackResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - options - FqdnListGlobalRulestackClientListOptions contains the optional parameters for the FqdnListGlobalRulestackClient.NewListPager // method. @@ -268,7 +279,7 @@ func (client *FqdnListGlobalRulestackClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client_example_test.go deleted file mode 100644 index 4ae5dc4920ae..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistglobalrulestack_client_example_test.go +++ /dev/null @@ -1,311 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_List_MaximumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_NewListPager_fqdnListGlobalRulestackListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFqdnListGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FqdnListGlobalRulestackResourceListResult = armpanngfw.FqdnListGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.FqdnListGlobalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_List_MinimumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_NewListPager_fqdnListGlobalRulestackListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFqdnListGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FqdnListGlobalRulestackResourceListResult = armpanngfw.FqdnListGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.FqdnListGlobalRulestackResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/fqdnlists/fqdnlists1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_Get_MaximumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_Get_fqdnListGlobalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFqdnListGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListGlobalRulestackResource = armpanngfw.FqdnListGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("string"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_Get_MinimumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_Get_fqdnListGlobalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFqdnListGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListGlobalRulestackResource = armpanngfw.FqdnListGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/fqdnlists/armid1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_BeginCreateOrUpdate_fqdnListGlobalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.FqdnListGlobalRulestackResource{ - Properties: &armpanngfw.FqdnObject{ - Description: to.Ptr("string"), - AuditComment: to.Ptr("string"), - Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - FqdnList: []*string{ - to.Ptr("string1"), - to.Ptr("string2")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListGlobalRulestackResource = armpanngfw.FqdnListGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("string"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_BeginCreateOrUpdate_fqdnListGlobalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.FqdnListGlobalRulestackResource{ - Properties: &armpanngfw.FqdnObject{ - FqdnList: []*string{ - to.Ptr("string1"), - to.Ptr("string2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListGlobalRulestackResource = armpanngfw.FqdnListGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/fqdnlists/armid1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_Delete_MaximumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_BeginDelete_fqdnListGlobalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListGlobalRulestack_Delete_MinimumSet_Gen.json -func ExampleFqdnListGlobalRulestackClient_BeginDelete_fqdnListGlobalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go index d1fe4f15d10d..407dee099bc6 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,7 +46,7 @@ func NewFqdnListLocalRulestackClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Create a FqdnListLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - fqdn list name @@ -60,9 +59,10 @@ func (client *FqdnListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FqdnListLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *FqdnListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create a FqdnListLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FqdnListLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource FqdnListLocalRulestackResource, options *FqdnListLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ func (client *FqdnListLocalRulestackClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a FqdnListLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - fqdn list name @@ -132,9 +137,10 @@ func (client *FqdnListLocalRulestackClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FqdnListLocalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[FqdnListLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ func (client *FqdnListLocalRulestackClient) BeginDelete(ctx context.Context, res // Delete - Delete a FqdnListLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *FqdnListLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *FqdnListLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -183,7 +191,7 @@ func (client *FqdnListLocalRulestackClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,25 +200,28 @@ func (client *FqdnListLocalRulestackClient) deleteCreateRequest(ctx context.Cont // Get - Get a FqdnListLocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return FqdnListLocalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FqdnListLocalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FqdnListLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FqdnListLocalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,7 @@ func (client *FqdnListLocalRulestackClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,7 @@ func (client *FqdnListLocalRulestackClient) getHandleResponse(resp *http.Respons // NewListByLocalRulestacksPager - List FqdnListLocalRulestackResource resources by LocalRulestacks // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -307,7 +318,7 @@ func (client *FqdnListLocalRulestackClient) listByLocalRulestacksCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client_example_test.go deleted file mode 100644 index 5d6ad18216df..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/fqdnlistlocalrulestack_client_example_test.go +++ /dev/null @@ -1,311 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_NewListByLocalRulestacksPager_fqdnListLocalRulestackListByLocalRulestacksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFqdnListLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FqdnListLocalRulestackResourceListResult = armpanngfw.FqdnListLocalRulestackResourceListResult{ - // Value: []*armpanngfw.FqdnListLocalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_NewListByLocalRulestacksPager_fqdnListLocalRulestackListByLocalRulestacksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFqdnListLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FqdnListLocalRulestackResourceListResult = armpanngfw.FqdnListLocalRulestackResourceListResult{ - // Value: []*armpanngfw.FqdnListLocalRulestackResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/fqdnlists/fqdnlists1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_Get_MaximumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_Get_fqdnListLocalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFqdnListLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListLocalRulestackResource = armpanngfw.FqdnListLocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("string"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_Get_MinimumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_Get_fqdnListLocalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFqdnListLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListLocalRulestackResource = armpanngfw.FqdnListLocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/fqdnlists/armid1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_BeginCreateOrUpdate_fqdnListLocalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.FqdnListLocalRulestackResource{ - Properties: &armpanngfw.FqdnObject{ - Description: to.Ptr("string"), - AuditComment: to.Ptr("string"), - Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - FqdnList: []*string{ - to.Ptr("string1"), - to.Ptr("string2")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListLocalRulestackResource = armpanngfw.FqdnListLocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.FqdnObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("string"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_BeginCreateOrUpdate_fqdnListLocalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.FqdnListLocalRulestackResource{ - Properties: &armpanngfw.FqdnObject{ - FqdnList: []*string{ - to.Ptr("string1"), - to.Ptr("string2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FqdnListLocalRulestackResource = armpanngfw.FqdnListLocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/fqdnlists/armid1"), - // Properties: &armpanngfw.FqdnObject{ - // FqdnList: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_Delete_MaximumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_BeginDelete_fqdnListLocalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/FqdnListLocalRulestack_Delete_MinimumSet_Gen.json -func ExampleFqdnListLocalRulestackClient_BeginDelete_fqdnListLocalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFqdnListLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go index e2071d0f1763..f70e4eeb3098 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -45,7 +44,7 @@ func NewGlobalRulestackClient(credential azcore.TokenCredential, options *arm.Cl // BeginCommit - Commit rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - options - GlobalRulestackClientBeginCommitOptions contains the optional parameters for the GlobalRulestackClient.BeginCommit // method. @@ -55,9 +54,10 @@ func (client *GlobalRulestackClient) BeginCommit(ctx context.Context, globalRule if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCommitResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCommitResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GlobalRulestackClientCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -66,20 +66,22 @@ func (client *GlobalRulestackClient) BeginCommit(ctx context.Context, globalRule // Commit - Commit rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *GlobalRulestackClient) commit(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginCommitOptions) (*http.Response, error) { + var err error req, err := client.commitCreateRequest(ctx, globalRulestackName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitCreateRequest creates the Commit request. @@ -94,7 +96,7 @@ func (client *GlobalRulestackClient) commitCreateRequest(ctx context.Context, gl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,7 +105,7 @@ func (client *GlobalRulestackClient) commitCreateRequest(ctx context.Context, gl // BeginCreateOrUpdate - Create a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - resource - Resource create parameters. // - options - GlobalRulestackClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalRulestackClient.BeginCreateOrUpdate @@ -114,9 +116,10 @@ func (client *GlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, gl if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -125,20 +128,22 @@ func (client *GlobalRulestackClient) BeginCreateOrUpdate(ctx context.Context, gl // CreateOrUpdate - Create a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *GlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, resource GlobalRulestackResource, options *GlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -153,16 +158,19 @@ func (client *GlobalRulestackClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - options - GlobalRulestackClientBeginDeleteOptions contains the optional parameters for the GlobalRulestackClient.BeginDelete // method. @@ -172,9 +180,10 @@ func (client *GlobalRulestackClient) BeginDelete(ctx context.Context, globalRule if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -183,20 +192,22 @@ func (client *GlobalRulestackClient) BeginDelete(ctx context.Context, globalRule // Delete - Delete a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *GlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, options *GlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -211,7 +222,7 @@ func (client *GlobalRulestackClient) deleteCreateRequest(ctx context.Context, gl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,22 +231,25 @@ func (client *GlobalRulestackClient) deleteCreateRequest(ctx context.Context, gl // Get - Get a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -250,7 +264,7 @@ func (client *GlobalRulestackClient) getCreateRequest(ctx context.Context, globa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,23 +282,26 @@ func (client *GlobalRulestackClient) getHandleResponse(resp *http.Response) (Glo // GetChangeLog - Get changelog // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getChangeLogCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientGetChangeLogResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientGetChangeLogResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientGetChangeLogResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientGetChangeLogResponse{}, err } - return client.getChangeLogHandleResponse(resp) + resp, err := client.getChangeLogHandleResponse(httpResp) + return resp, err } // getChangeLogCreateRequest creates the GetChangeLog request. @@ -299,7 +316,7 @@ func (client *GlobalRulestackClient) getChangeLogCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +333,7 @@ func (client *GlobalRulestackClient) getChangeLogHandleResponse(resp *http.Respo // NewListPager - List GlobalRulestackResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - options - GlobalRulestackClientListOptions contains the optional parameters for the GlobalRulestackClient.NewListPager // method. func (client *GlobalRulestackClient) NewListPager(options *GlobalRulestackClientListOptions) *runtime.Pager[GlobalRulestackClientListResponse] { @@ -355,7 +372,7 @@ func (client *GlobalRulestackClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,23 +390,26 @@ func (client *GlobalRulestackClient) listHandleResponse(resp *http.Response) (Gl // 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 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listAdvancedSecurityObjectsCreateRequest(ctx, globalRulestackName, typeParam, options) if err != nil { return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListAdvancedSecurityObjectsResponse{}, err } - return client.listAdvancedSecurityObjectsHandleResponse(resp) + resp, err := client.listAdvancedSecurityObjectsHandleResponse(httpResp) + return resp, err } // listAdvancedSecurityObjectsCreateRequest creates the ListAdvancedSecurityObjects request. @@ -404,7 +424,7 @@ func (client *GlobalRulestackClient) listAdvancedSecurityObjectsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -429,23 +449,26 @@ func (client *GlobalRulestackClient) listAdvancedSecurityObjectsHandleResponse(r // ListAppIDs - List of AppIds for GlobalRulestack ApiVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listAppIDsCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientListAppIDsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListAppIDsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListAppIDsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListAppIDsResponse{}, err } - return client.listAppIDsHandleResponse(resp) + resp, err := client.listAppIDsHandleResponse(httpResp) + return resp, err } // listAppIDsCreateRequest creates the ListAppIDs request. @@ -460,7 +483,7 @@ func (client *GlobalRulestackClient) listAppIDsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.AppIDVersion != nil { reqQP.Set("appIdVersion", *options.AppIDVersion) } @@ -490,23 +513,26 @@ func (client *GlobalRulestackClient) listAppIDsHandleResponse(resp *http.Respons // ListCountries - List of countries for Rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listCountriesCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientListCountriesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListCountriesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListCountriesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListCountriesResponse{}, err } - return client.listCountriesHandleResponse(resp) + resp, err := client.listCountriesHandleResponse(httpResp) + return resp, err } // listCountriesCreateRequest creates the ListCountries request. @@ -521,7 +547,7 @@ func (client *GlobalRulestackClient) listCountriesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -545,23 +571,26 @@ func (client *GlobalRulestackClient) listCountriesHandleResponse(resp *http.Resp // ListFirewalls - List of Firewalls associated with Rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listFirewallsCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientListFirewallsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListFirewallsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListFirewallsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListFirewallsResponse{}, err } - return client.listFirewallsHandleResponse(resp) + resp, err := client.listFirewallsHandleResponse(httpResp) + return resp, err } // listFirewallsCreateRequest creates the ListFirewalls request. @@ -576,7 +605,7 @@ func (client *GlobalRulestackClient) listFirewallsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -594,23 +623,26 @@ func (client *GlobalRulestackClient) listFirewallsHandleResponse(resp *http.Resp // ListPredefinedURLCategories - List predefined URL categories for rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listPredefinedURLCategoriesCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListPredefinedURLCategoriesResponse{}, err } - return client.listPredefinedURLCategoriesHandleResponse(resp) + resp, err := client.listPredefinedURLCategoriesHandleResponse(httpResp) + return resp, err } // listPredefinedURLCategoriesCreateRequest creates the ListPredefinedURLCategories request. @@ -625,7 +657,7 @@ func (client *GlobalRulestackClient) listPredefinedURLCategoriesCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -649,23 +681,26 @@ func (client *GlobalRulestackClient) listPredefinedURLCategoriesHandleResponse(r // ListSecurityServices - List the security services for rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listSecurityServicesCreateRequest(ctx, globalRulestackName, typeParam, options) if err != nil { return GlobalRulestackClientListSecurityServicesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientListSecurityServicesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientListSecurityServicesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientListSecurityServicesResponse{}, err } - return client.listSecurityServicesHandleResponse(resp) + resp, err := client.listSecurityServicesHandleResponse(httpResp) + return resp, err } // listSecurityServicesCreateRequest creates the ListSecurityServices request. @@ -680,7 +715,7 @@ func (client *GlobalRulestackClient) listSecurityServicesCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -705,20 +740,22 @@ func (client *GlobalRulestackClient) listSecurityServicesHandleResponse(resp *ht // Revert - Revert rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.revertCreateRequest(ctx, globalRulestackName, options) if err != nil { return GlobalRulestackClientRevertResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientRevertResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return GlobalRulestackClientRevertResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientRevertResponse{}, err } return GlobalRulestackClientRevertResponse{}, nil } @@ -735,7 +772,7 @@ func (client *GlobalRulestackClient) revertCreateRequest(ctx context.Context, gl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -744,23 +781,26 @@ func (client *GlobalRulestackClient) revertCreateRequest(ctx context.Context, gl // Update - Update a GlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.updateCreateRequest(ctx, globalRulestackName, properties, options) if err != nil { return GlobalRulestackClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalRulestackClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalRulestackClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalRulestackClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -775,10 +815,13 @@ func (client *GlobalRulestackClient) updateCreateRequest(ctx context.Context, gl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client_example_test.go deleted file mode 100644 index cf8074e1736e..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/globalrulestack_client_example_test.go +++ /dev/null @@ -1,987 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_List_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_NewListPager_globalRulestackListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGlobalRulestackClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GlobalRulestackResourceListResult = armpanngfw.GlobalRulestackResourceListResult{ - // Value: []*armpanngfw.GlobalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("aaaaaaaaaa"), - // AntiVirusProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // DNSSubscription: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // FileBlockingProfile: to.Ptr("aaaaa"), - // OutboundTrustCertificate: to.Ptr("aaaaaa"), - // OutboundUnTrustCertificate: to.Ptr("aaaaaaaa"), - // URLFilteringProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // VulnerabilityProfile: to.Ptr("aaaaaaaaaa"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_List_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_NewListPager_globalRulestackListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGlobalRulestackClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GlobalRulestackResourceListResult = armpanngfw.GlobalRulestackResourceListResult{ - // Value: []*armpanngfw.GlobalRulestackResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/grs1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Get_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_Get_globalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().Get(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("globalRulestacks"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("global rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeGLOBAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Get_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_Get_globalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().Get(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_BeginCreateOrUpdate_globalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", armpanngfw.GlobalRulestackResource{ - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armpanngfw.RulestackProperties{ - Description: to.Ptr("global rulestacks"), - AssociatedSubscriptions: []*string{ - to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - MinAppIDVersion: to.Ptr("8.5.3"), - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanLocation: to.Ptr("eastus"), - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - Scope: to.Ptr(armpanngfw.ScopeTypeGLOBAL), - SecurityServices: &armpanngfw.SecurityServices{ - AntiSpywareProfile: to.Ptr("default"), - AntiVirusProfile: to.Ptr("default"), - DNSSubscription: to.Ptr("default"), - FileBlockingProfile: to.Ptr("default"), - OutboundTrustCertificate: to.Ptr("default"), - OutboundUnTrustCertificate: to.Ptr("default"), - URLFilteringProfile: to.Ptr("default"), - VulnerabilityProfile: to.Ptr("default"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("globalRulestacks"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("global rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeGLOBAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_BeginCreateOrUpdate_globalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", armpanngfw.GlobalRulestackResource{ - Location: to.Ptr("eastus"), - Properties: &armpanngfw.RulestackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Update_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_Update_globalRulestackUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().Update(ctx, "praval", armpanngfw.GlobalRulestackResourceUpdate{ - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armpanngfw.GlobalRulestackResourceUpdateProperties{ - Description: to.Ptr("global rulestacks"), - AssociatedSubscriptions: []*string{ - to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - MinAppIDVersion: to.Ptr("8.5.3"), - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanLocation: to.Ptr("eastus"), - Scope: to.Ptr(armpanngfw.ScopeTypeGLOBAL), - SecurityServices: &armpanngfw.SecurityServices{ - AntiSpywareProfile: to.Ptr("default"), - AntiVirusProfile: to.Ptr("default"), - DNSSubscription: to.Ptr("default"), - FileBlockingProfile: to.Ptr("default"), - OutboundTrustCertificate: to.Ptr("default"), - OutboundUnTrustCertificate: to.Ptr("default"), - URLFilteringProfile: to.Ptr("default"), - VulnerabilityProfile: to.Ptr("default"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("globalRulestacks"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("global rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeGLOBAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Update_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_Update_globalRulestackUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().Update(ctx, "praval", armpanngfw.GlobalRulestackResourceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalRulestackResource = armpanngfw.GlobalRulestackResource{ - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Delete_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_BeginDelete_globalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginDelete(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_Delete_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_BeginDelete_globalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginDelete(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_commit_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_BeginCommit_globalRulestackCommitMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginCommit(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_commit_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_BeginCommit_globalRulestackCommitMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalRulestackClient().BeginCommit(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_getChangeLog_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_GetChangeLog_globalRulestackGetChangeLogMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().GetChangeLog(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Changelog = armpanngfw.Changelog{ - // Changes: []*string{ - // to.Ptr("aaaa")}, - // LastCommitted: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_getChangeLog_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_GetChangeLog_globalRulestackGetChangeLogMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().GetChangeLog(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Changelog = armpanngfw.Changelog{ - // Changes: []*string{ - // to.Ptr("aaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listAdvancedSecurityObjects_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListAdvancedSecurityObjects_globalRulestackListAdvancedSecurityObjectsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListAdvancedSecurityObjects(ctx, "praval", armpanngfw.AdvSecurityObjectTypeEnum("globalRulestacks"), &armpanngfw.GlobalRulestackClientListAdvancedSecurityObjectsOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvSecurityObjectListResponse = armpanngfw.AdvSecurityObjectListResponse{ - // Value: &armpanngfw.AdvSecurityObjectModel{ - // Type: to.Ptr("globalRulestacks"), - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // Description: to.Ptr("aaaaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listAdvancedSecurityObjects_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListAdvancedSecurityObjects_globalRulestackListAdvancedSecurityObjectsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListAdvancedSecurityObjects(ctx, "praval", armpanngfw.AdvSecurityObjectTypeEnum("globalRulestacks"), &armpanngfw.GlobalRulestackClientListAdvancedSecurityObjectsOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvSecurityObjectListResponse = armpanngfw.AdvSecurityObjectListResponse{ - // Value: &armpanngfw.AdvSecurityObjectModel{ - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listAppIds_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListAppIDs_globalRulestackListAppIdsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListAppIDs(ctx, "praval", &armpanngfw.GlobalRulestackClientListAppIDsOptions{AppIDVersion: to.Ptr("8543"), - AppPrefix: to.Ptr("pref"), - Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListAppIDResponse = armpanngfw.ListAppIDResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listAppIds_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListAppIDs_globalRulestackListAppIdsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListAppIDs(ctx, "praval", &armpanngfw.GlobalRulestackClientListAppIDsOptions{AppIDVersion: nil, - AppPrefix: nil, - Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListAppIDResponse = armpanngfw.ListAppIDResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listCountries_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListCountries_globalRulestackListCountriesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListCountries(ctx, "praval", &armpanngfw.GlobalRulestackClientListCountriesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountriesResponse = armpanngfw.CountriesResponse{ - // Value: []*armpanngfw.Country{ - // { - // Description: to.Ptr("aaaaa"), - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listCountries_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListCountries_globalRulestackListCountriesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListCountries(ctx, "praval", &armpanngfw.GlobalRulestackClientListCountriesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountriesResponse = armpanngfw.CountriesResponse{ - // Value: []*armpanngfw.Country{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listFirewalls_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListFirewalls_globalRulestackListFirewallsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListFirewalls(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListFirewallsResponse = armpanngfw.ListFirewallsResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listFirewalls_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListFirewalls_globalRulestackListFirewallsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListFirewalls(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListFirewallsResponse = armpanngfw.ListFirewallsResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listPredefinedUrlCategories_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListPredefinedURLCategories_globalRulestackListPredefinedUrlCategoriesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListPredefinedURLCategories(ctx, "praval", &armpanngfw.GlobalRulestackClientListPredefinedURLCategoriesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PredefinedURLCategoriesResponse = armpanngfw.PredefinedURLCategoriesResponse{ - // Value: []*armpanngfw.PredefinedURLCategory{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Action: to.Ptr("aaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listPredefinedUrlCategories_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListPredefinedURLCategories_globalRulestackListPredefinedUrlCategoriesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListPredefinedURLCategories(ctx, "praval", &armpanngfw.GlobalRulestackClientListPredefinedURLCategoriesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PredefinedURLCategoriesResponse = armpanngfw.PredefinedURLCategoriesResponse{ - // Value: []*armpanngfw.PredefinedURLCategory{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Action: to.Ptr("aaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listSecurityServices_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_ListSecurityServices_globalRulestackListSecurityServicesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListSecurityServices(ctx, "praval", armpanngfw.SecurityServicesTypeEnum("globalRulestacks"), &armpanngfw.GlobalRulestackClientListSecurityServicesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityServicesResponse = armpanngfw.SecurityServicesResponse{ - // Value: &armpanngfw.SecurityServicesTypeList{ - // Type: to.Ptr("globalRulestacks"), - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // Description: to.Ptr("aaaaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_listSecurityServices_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_ListSecurityServices_globalRulestackListSecurityServicesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalRulestackClient().ListSecurityServices(ctx, "praval", armpanngfw.SecurityServicesTypeEnum("globalRulestacks"), &armpanngfw.GlobalRulestackClientListSecurityServicesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityServicesResponse = armpanngfw.SecurityServicesResponse{ - // Value: &armpanngfw.SecurityServicesTypeList{ - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_revert_MaximumSet_Gen.json -func ExampleGlobalRulestackClient_Revert_globalRulestackRevertMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGlobalRulestackClient().Revert(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/GlobalRulestack_revert_MinimumSet_Gen.json -func ExampleGlobalRulestackClient_Revert_globalRulestackRevertMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGlobalRulestackClient().Revert(ctx, "praval", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.mod b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.mod index 7a60938d8e0e..de8414cc27d8 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.mod +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.sum b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.sum index 21718b486698..727ce838bdc8 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.sum +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go index d41cc49c1431..795bf18986a8 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,7 +46,7 @@ func NewLocalRulesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create a LocalRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - priority - Local Rule priority @@ -60,9 +59,10 @@ func (client *LocalRulesClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[LocalRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *LocalRulesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a LocalRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *LocalRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, resource LocalRulesResource, options *LocalRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, priority, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ func (client *LocalRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a LocalRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - priority - Local Rule priority @@ -131,9 +136,10 @@ func (client *LocalRulesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[LocalRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ func (client *LocalRulesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a LocalRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *LocalRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, priority string, options *LocalRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,7 @@ func (client *LocalRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,24 +199,27 @@ func (client *LocalRulesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a LocalRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) if err != nil { return LocalRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,7 @@ func (client *LocalRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,24 +264,27 @@ func (client *LocalRulesClient) getHandleResponse(resp *http.Response) (LocalRul // GetCounters - Get counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) if err != nil { return LocalRulesClientGetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulesClientGetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulesClientGetCountersResponse{}, err } - return client.getCountersHandleResponse(resp) + resp, err := client.getCountersHandleResponse(httpResp) + return resp, err } // getCountersCreateRequest creates the GetCounters request. @@ -297,7 +311,7 @@ func (client *LocalRulesClient) getCountersCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -317,7 +331,7 @@ func (client *LocalRulesClient) getCountersHandleResponse(resp *http.Response) ( // NewListByLocalRulestacksPager - List LocalRulesResource resources by LocalRulestacks // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -370,7 +384,7 @@ func (client *LocalRulesClient) listByLocalRulestacksCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,23 +402,25 @@ func (client *LocalRulesClient) listByLocalRulestacksHandleResponse(resp *http.R // RefreshCounters - Refresh counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.refreshCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) if err != nil { return LocalRulesClientRefreshCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulesClientRefreshCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return LocalRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return LocalRulesClientRefreshCountersResponse{}, err } return LocalRulesClientRefreshCountersResponse{}, nil } @@ -433,7 +449,7 @@ func (client *LocalRulesClient) refreshCountersCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -445,25 +461,28 @@ func (client *LocalRulesClient) refreshCountersCreateRequest(ctx context.Context // ResetCounters - Reset counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.resetCountersCreateRequest(ctx, resourceGroupName, localRulestackName, priority, options) if err != nil { return LocalRulesClientResetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulesClientResetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulesClientResetCountersResponse{}, err } - return client.resetCountersHandleResponse(resp) + resp, err := client.resetCountersHandleResponse(httpResp) + return resp, err } // resetCountersCreateRequest creates the ResetCounters request. @@ -490,7 +509,7 @@ func (client *LocalRulesClient) resetCountersCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client_example_test.go deleted file mode 100644 index da5303f52a38..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrules_client_example_test.go +++ /dev/null @@ -1,629 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_ListByLocalRulestacks_MaximumSet_Gen.json -func ExampleLocalRulesClient_NewListByLocalRulestacksPager_localRulesListByLocalRulestacksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulesClient().NewListByLocalRulestacksPager("firewall-rg", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulesResourceListResult = armpanngfw.LocalRulesResourceListResult{ - // Value: []*armpanngfw.LocalRulesResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("a"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_ListByLocalRulestacks_MinimumSet_Gen.json -func ExampleLocalRulesClient_NewListByLocalRulestacksPager_localRulesListByLocalRulestacksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulesClient().NewListByLocalRulestacksPager("firewall-rg", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulesResourceListResult = armpanngfw.LocalRulesResourceListResult{ - // Value: []*armpanngfw.LocalRulesResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/lrs1/localrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_Get_MaximumSet_Gen.json -func ExampleLocalRulesClient_Get_localRulesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().Get(ctx, "firewall-rg", "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulesResource = armpanngfw.LocalRulesResource{ - // Name: to.Ptr("aaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](13), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_Get_MinimumSet_Gen.json -func ExampleLocalRulesClient_Get_localRulesGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().Get(ctx, "firewall-rg", "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulesResource = armpanngfw.LocalRulesResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/grs1/localrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_CreateOrUpdate_MaximumSet_Gen.json -func ExampleLocalRulesClient_BeginCreateOrUpdate_localRulesCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulesClient().BeginCreateOrUpdate(ctx, "firewall-rg", "lrs1", "1", armpanngfw.LocalRulesResource{ - Properties: &armpanngfw.RuleEntry{ - Description: to.Ptr("description of local rule"), - ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - Applications: []*string{ - to.Ptr("app1")}, - AuditComment: to.Ptr("example comment"), - Category: &armpanngfw.Category{ - Feeds: []*string{ - to.Ptr("feed")}, - URLCustom: []*string{ - to.Ptr("https://microsoft.com")}, - }, - DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - Destination: &armpanngfw.DestinationAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - FqdnLists: []*string{ - to.Ptr("FQDN1")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - Etag: to.Ptr("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0"), - InboundInspectionCertificate: to.Ptr("cert1"), - NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - ProtocolPortList: []*string{ - to.Ptr("80")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - RuleName: to.Ptr("localRule1"), - RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - Source: &armpanngfw.SourceAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - Tags: []*armpanngfw.TagInfo{ - { - Key: to.Ptr("keyName"), - Value: to.Ptr("value"), - }}, - Protocol: to.Ptr("HTTP"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulesResource = armpanngfw.LocalRulesResource{ - // Name: to.Ptr("aaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](13), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_CreateOrUpdate_MinimumSet_Gen.json -func ExampleLocalRulesClient_BeginCreateOrUpdate_localRulesCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulesClient().BeginCreateOrUpdate(ctx, "firewall-rg", "lrs1", "1", armpanngfw.LocalRulesResource{ - Properties: &armpanngfw.RuleEntry{ - RuleName: to.Ptr("localRule1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulesResource = armpanngfw.LocalRulesResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/grs1/localrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_Delete_MaximumSet_Gen.json -func ExampleLocalRulesClient_BeginDelete_localRulesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulesClient().BeginDelete(ctx, "firewall-rg", "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_Delete_MinimumSet_Gen.json -func ExampleLocalRulesClient_BeginDelete_localRulesDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulesClient().BeginDelete(ctx, "firewall-rg", "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_getCounters_MaximumSet_Gen.json -func ExampleLocalRulesClient_GetCounters_localRulesGetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().GetCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientGetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // AppSeen: &armpanngfw.AppSeenData{ - // AppSeenList: []*armpanngfw.AppSeenInfo{ - // { - // Category: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Risk: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // StandardPorts: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SubCategory: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Tag: to.Ptr("aaaaaaaaaa"), - // Technology: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Title: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // Count: to.Ptr[int32](13), - // }, - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // HitCount: to.Ptr[int32](20), - // LastUpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RequestTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // RuleListName: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // RuleStackName: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_getCounters_MinimumSet_Gen.json -func ExampleLocalRulesClient_GetCounters_localRulesGetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().GetCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientGetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_refreshCounters_MaximumSet_Gen.json -func ExampleLocalRulesClient_RefreshCounters_localRulesRefreshCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLocalRulesClient().RefreshCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientRefreshCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_refreshCounters_MinimumSet_Gen.json -func ExampleLocalRulesClient_RefreshCounters_localRulesRefreshCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLocalRulesClient().RefreshCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientRefreshCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_resetCounters_MaximumSet_Gen.json -func ExampleLocalRulesClient_ResetCounters_localRulesResetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().ResetCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientResetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Priority: to.Ptr("aaaaaaa"), - // RuleListName: to.Ptr("aaaaa"), - // RuleName: to.Ptr("aaaaa"), - // RuleStackName: to.Ptr("aa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_resetCounters_MinimumSet_Gen.json -func ExampleLocalRulesClient_ResetCounters_localRulesResetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulesClient().ResetCounters(ctx, "firewall-rg", "lrs1", "1", &armpanngfw.LocalRulesClientResetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go index 8419650d47ab..59da5a93500c 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -48,7 +47,7 @@ func NewLocalRulestacksClient(subscriptionID string, credential azcore.TokenCred // BeginCommit - Commit rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -59,9 +58,10 @@ func (client *LocalRulestacksClient) BeginCommit(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCommitResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCommitResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[LocalRulestacksClientCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *LocalRulestacksClient) BeginCommit(ctx context.Context, resourceGr // Commit - Commit rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *LocalRulestacksClient) commit(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginCommitOptions) (*http.Response, error) { + var err error req, err := client.commitCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitCreateRequest creates the Commit request. @@ -106,7 +108,7 @@ func (client *LocalRulestacksClient) commitCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +117,7 @@ func (client *LocalRulestacksClient) commitCreateRequest(ctx context.Context, re // BeginCreateOrUpdate - Create a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - resource - Resource create parameters. @@ -127,9 +129,10 @@ func (client *LocalRulestacksClient) BeginCreateOrUpdate(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[LocalRulestacksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,20 +141,22 @@ func (client *LocalRulestacksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *LocalRulestacksClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, resource LocalRulestackResource, options *LocalRulestacksClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -174,16 +179,19 @@ func (client *LocalRulestacksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -194,9 +202,10 @@ func (client *LocalRulestacksClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LocalRulestacksClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[LocalRulestacksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -205,20 +214,22 @@ func (client *LocalRulestacksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *LocalRulestacksClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, options *LocalRulestacksClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -241,7 +252,7 @@ func (client *LocalRulestacksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,23 +261,26 @@ func (client *LocalRulestacksClient) deleteCreateRequest(ctx context.Context, re // Get - Get a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return LocalRulestacksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -289,7 +303,7 @@ func (client *LocalRulestacksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,24 +321,27 @@ func (client *LocalRulestacksClient) getHandleResponse(resp *http.Response) (Loc // GetChangeLog - Get changelog // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getChangeLogCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return LocalRulestacksClientGetChangeLogResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientGetChangeLogResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientGetChangeLogResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientGetChangeLogResponse{}, err } - return client.getChangeLogHandleResponse(resp) + resp, err := client.getChangeLogHandleResponse(httpResp) + return resp, err } // getChangeLogCreateRequest creates the GetChangeLog request. @@ -347,7 +364,7 @@ func (client *LocalRulestacksClient) getChangeLogCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,24 +382,27 @@ func (client *LocalRulestacksClient) getChangeLogHandleResponse(resp *http.Respo // GetSupportInfo - support info for rulestack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getSupportInfoCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return LocalRulestacksClientGetSupportInfoResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientGetSupportInfoResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientGetSupportInfoResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientGetSupportInfoResponse{}, err } - return client.getSupportInfoHandleResponse(resp) + resp, err := client.getSupportInfoHandleResponse(httpResp) + return resp, err } // getSupportInfoCreateRequest creates the GetSupportInfo request. @@ -405,7 +425,7 @@ func (client *LocalRulestacksClient) getSupportInfoCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Email != nil { reqQP.Set("email", *options.Email) } @@ -426,24 +446,27 @@ func (client *LocalRulestacksClient) getSupportInfoHandleResponse(resp *http.Res // 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 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listAdvancedSecurityObjectsCreateRequest(ctx, resourceGroupName, localRulestackName, typeParam, options) if err != nil { return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientListAdvancedSecurityObjectsResponse{}, err } - return client.listAdvancedSecurityObjectsHandleResponse(resp) + resp, err := client.listAdvancedSecurityObjectsHandleResponse(httpResp) + return resp, err } // listAdvancedSecurityObjectsCreateRequest creates the ListAdvancedSecurityObjects request. @@ -466,7 +489,7 @@ func (client *LocalRulestacksClient) listAdvancedSecurityObjectsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -488,29 +511,6 @@ func (client *LocalRulestacksClient) listAdvancedSecurityObjectsHandleResponse(r 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" @@ -531,7 +531,7 @@ func (client *LocalRulestacksClient) listAppIDsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.AppIDVersion != nil { reqQP.Set("appIdVersion", *options.AppIDVersion) } @@ -560,7 +560,7 @@ func (client *LocalRulestacksClient) listAppIDsHandleResponse(resp *http.Respons // NewListByResourceGroupPager - List LocalRulestackResource resources by resource group // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - LocalRulestacksClientListByResourceGroupOptions contains the optional parameters for the LocalRulestacksClient.NewListByResourceGroupPager // method. @@ -608,7 +608,7 @@ func (client *LocalRulestacksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -625,7 +625,7 @@ func (client *LocalRulestacksClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List LocalRulestackResource resources by subscription ID // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - options - LocalRulestacksClientListBySubscriptionOptions contains the optional parameters for the LocalRulestacksClient.NewListBySubscriptionPager // method. func (client *LocalRulestacksClient) NewListBySubscriptionPager(options *LocalRulestacksClientListBySubscriptionOptions) *runtime.Pager[LocalRulestacksClientListBySubscriptionResponse] { @@ -668,7 +668,7 @@ func (client *LocalRulestacksClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -683,29 +683,6 @@ func (client *LocalRulestacksClient) listBySubscriptionHandleResponse(resp *http 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" @@ -726,7 +703,7 @@ func (client *LocalRulestacksClient) listCountriesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -750,24 +727,27 @@ func (client *LocalRulestacksClient) listCountriesHandleResponse(resp *http.Resp // ListFirewalls - List of Firewalls associated with Rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listFirewallsCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return LocalRulestacksClientListFirewallsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientListFirewallsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientListFirewallsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientListFirewallsResponse{}, err } - return client.listFirewallsHandleResponse(resp) + resp, err := client.listFirewallsHandleResponse(httpResp) + return resp, err } // listFirewallsCreateRequest creates the ListFirewalls request. @@ -790,7 +770,7 @@ func (client *LocalRulestacksClient) listFirewallsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -805,29 +785,6 @@ func (client *LocalRulestacksClient) listFirewallsHandleResponse(resp *http.Resp 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" @@ -848,7 +805,7 @@ func (client *LocalRulestacksClient) listPredefinedURLCategoriesCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -872,24 +829,27 @@ func (client *LocalRulestacksClient) listPredefinedURLCategoriesHandleResponse(r // ListSecurityServices - List the security services for rulestack // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.listSecurityServicesCreateRequest(ctx, resourceGroupName, localRulestackName, typeParam, options) if err != nil { return LocalRulestacksClientListSecurityServicesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientListSecurityServicesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientListSecurityServicesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientListSecurityServicesResponse{}, err } - return client.listSecurityServicesHandleResponse(resp) + resp, err := client.listSecurityServicesHandleResponse(httpResp) + return resp, err } // listSecurityServicesCreateRequest creates the ListSecurityServices request. @@ -912,7 +872,7 @@ func (client *LocalRulestacksClient) listSecurityServicesCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.Skip != nil { reqQP.Set("skip", *options.Skip) } @@ -937,21 +897,23 @@ func (client *LocalRulestacksClient) listSecurityServicesHandleResponse(resp *ht // Revert - Revert rulestack configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.revertCreateRequest(ctx, resourceGroupName, localRulestackName, options) if err != nil { return LocalRulestacksClientRevertResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientRevertResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return LocalRulestacksClientRevertResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientRevertResponse{}, err } return LocalRulestacksClientRevertResponse{}, nil } @@ -976,7 +938,7 @@ func (client *LocalRulestacksClient) revertCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -985,24 +947,27 @@ func (client *LocalRulestacksClient) revertCreateRequest(ctx context.Context, re // Update - Update a LocalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, localRulestackName, properties, options) if err != nil { return LocalRulestacksClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocalRulestacksClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocalRulestacksClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocalRulestacksClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -1025,10 +990,13 @@ func (client *LocalRulestacksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client_example_test.go deleted file mode 100644 index 1e6c663a4a74..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/localrulestacks_client_example_test.go +++ /dev/null @@ -1,1171 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_ListBySubscription_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_NewListBySubscriptionPager_localRulestacksListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulestacksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulestackResourceListResult = armpanngfw.LocalRulestackResourceListResult{ - // Value: []*armpanngfw.LocalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("aaaaaaaaaa"), - // AntiVirusProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // DNSSubscription: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // FileBlockingProfile: to.Ptr("aaaaa"), - // OutboundTrustCertificate: to.Ptr("aaaaaa"), - // OutboundUnTrustCertificate: to.Ptr("aaaaaaaa"), - // URLFilteringProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // VulnerabilityProfile: to.Ptr("aaaaaaaaaa"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_ListBySubscription_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_NewListBySubscriptionPager_localRulestacksListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulestacksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulestackResourceListResult = armpanngfw.LocalRulestackResourceListResult{ - // Value: []*armpanngfw.LocalRulestackResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/lrs1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_ListByResourceGroup_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_NewListByResourceGroupPager_localRulestacksListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulestacksClient().NewListByResourceGroupPager("rgopenapi", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulestackResourceListResult = armpanngfw.LocalRulestackResourceListResult{ - // Value: []*armpanngfw.LocalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("aaaaaaaaaa"), - // AntiVirusProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // DNSSubscription: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // FileBlockingProfile: to.Ptr("aaaaa"), - // OutboundTrustCertificate: to.Ptr("aaaaaa"), - // OutboundUnTrustCertificate: to.Ptr("aaaaaaaa"), - // URLFilteringProfile: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // VulnerabilityProfile: to.Ptr("aaaaaaaaaa"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_ListByResourceGroup_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_NewListByResourceGroupPager_localRulestacksListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalRulestacksClient().NewListByResourceGroupPager("rgopenapi", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LocalRulestackResourceListResult = armpanngfw.LocalRulestackResourceListResult{ - // Value: []*armpanngfw.LocalRulestackResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/lrs1"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Get_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_Get_localRulestacksGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().Get(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("localRulestacks"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("local rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Get_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_Get_localRulestacksGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().Get(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_CreateOrUpdate_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_BeginCreateOrUpdate_localRulestacksCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", armpanngfw.LocalRulestackResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagName": to.Ptr("value"), - }, - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Properties: &armpanngfw.RulestackProperties{ - Description: to.Ptr("local rulestacks"), - AssociatedSubscriptions: []*string{ - to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - MinAppIDVersion: to.Ptr("8.5.3"), - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanLocation: to.Ptr("eastus"), - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - SecurityServices: &armpanngfw.SecurityServices{ - AntiSpywareProfile: to.Ptr("default"), - AntiVirusProfile: to.Ptr("default"), - DNSSubscription: to.Ptr("default"), - FileBlockingProfile: to.Ptr("default"), - OutboundTrustCertificate: to.Ptr("default"), - OutboundUnTrustCertificate: to.Ptr("default"), - URLFilteringProfile: to.Ptr("default"), - VulnerabilityProfile: to.Ptr("default"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("localRulestacks"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("local rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_CreateOrUpdate_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_BeginCreateOrUpdate_localRulestacksCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", armpanngfw.LocalRulestackResource{ - Location: to.Ptr("eastus"), - Properties: &armpanngfw.RulestackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval"), - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Update_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_Update_localRulestacksUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().Update(ctx, "rgopenapi", "lrs1", armpanngfw.LocalRulestackResourceUpdate{ - Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - "key16": { - ClientID: to.Ptr("aaaa"), - PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - }, - }, - }, - Properties: &armpanngfw.LocalRulestackResourceUpdateProperties{ - Description: to.Ptr("local rulestacks"), - AssociatedSubscriptions: []*string{ - to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - MinAppIDVersion: to.Ptr("8.5.3"), - PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - PanLocation: to.Ptr("eastus"), - Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - SecurityServices: &armpanngfw.SecurityServices{ - AntiSpywareProfile: to.Ptr("default"), - AntiVirusProfile: to.Ptr("default"), - DNSSubscription: to.Ptr("default"), - FileBlockingProfile: to.Ptr("default"), - OutboundTrustCertificate: to.Ptr("default"), - OutboundUnTrustCertificate: to.Ptr("default"), - URLFilteringProfile: to.Ptr("default"), - VulnerabilityProfile: to.Ptr("default"), - }, - }, - Tags: map[string]*string{ - "tagName": to.Ptr("value"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("localRulestacks"), - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/firewall-rg/providers/PaloAltoNetworks.Cloudngfw/localrulestacks/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagName": to.Ptr("value"), - // }, - // Identity: &armpanngfw.AzureResourceManagerManagedIdentityProperties{ - // Type: to.Ptr(armpanngfw.ManagedIdentityTypeNone), - // PrincipalID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // TenantID: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // UserAssignedIdentities: map[string]*armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // "key16": &armpanngfw.AzureResourceManagerUserAssignedIdentity{ - // ClientID: to.Ptr("aaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Properties: &armpanngfw.RulestackProperties{ - // Description: to.Ptr("local rulestacks"), - // AssociatedSubscriptions: []*string{ - // to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")}, - // DefaultMode: to.Ptr(armpanngfw.DefaultModeIPS), - // MinAppIDVersion: to.Ptr("8.5.3"), - // PanEtag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c12"), - // PanLocation: to.Ptr("eastus"), - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // Scope: to.Ptr(armpanngfw.ScopeTypeLOCAL), - // SecurityServices: &armpanngfw.SecurityServices{ - // AntiSpywareProfile: to.Ptr("default"), - // AntiVirusProfile: to.Ptr("default"), - // DNSSubscription: to.Ptr("default"), - // FileBlockingProfile: to.Ptr("default"), - // OutboundTrustCertificate: to.Ptr("default"), - // OutboundUnTrustCertificate: to.Ptr("default"), - // URLFilteringProfile: to.Ptr("default"), - // VulnerabilityProfile: to.Ptr("default"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Update_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_Update_localRulestacksUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().Update(ctx, "rgopenapi", "lrs1", armpanngfw.LocalRulestackResourceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LocalRulestackResource = armpanngfw.LocalRulestackResource{ - // Location: to.Ptr("eastus"), - // Properties: &armpanngfw.RulestackProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Delete_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_BeginDelete_localRulestacksDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginDelete(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_Delete_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_BeginDelete_localRulestacksDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginDelete(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_commit_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_BeginCommit_localRulestacksCommitMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginCommit(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_commit_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_BeginCommit_localRulestacksCommitMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalRulestacksClient().BeginCommit(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_getChangeLog_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_GetChangeLog_localRulestacksGetChangeLogMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().GetChangeLog(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Changelog = armpanngfw.Changelog{ - // Changes: []*string{ - // to.Ptr("aaaa")}, - // LastCommitted: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_getChangeLog_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_GetChangeLog_localRulestacksGetChangeLogMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().GetChangeLog(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Changelog = armpanngfw.Changelog{ - // Changes: []*string{ - // to.Ptr("aaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_getSupportInfo_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_GetSupportInfo_localRulestacksGetSupportInfoMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().GetSupportInfo(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientGetSupportInfoOptions{Email: to.Ptr("user1@domain.com")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportInfo = armpanngfw.SupportInfo{ - // AccountID: to.Ptr("3cg5b439-294d-4c25-b0b2-ef649e0g6d38"), - // AccountRegistered: to.Ptr(armpanngfw.BooleanEnumTRUE), - // FreeTrial: to.Ptr(armpanngfw.BooleanEnumTRUE), - // FreeTrialCreditLeft: to.Ptr[int32](10), - // FreeTrialDaysLeft: to.Ptr[int32](1), - // HelpURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // ProductSerial: to.Ptr("e22715cb-7e4e-4814-ad4f-ccd1417755d7"), - // ProductSKU: to.Ptr("62f63e3c-bc5a-4d68-a8a1-fcba9f526c90"), - // RegisterURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // SupportURL: to.Ptr("https://ssopreview.paloaltonetworks.com/home/bookmark/0oa4ao61shG4rd3Ub1d7/2557"), - // UserDomainSupported: to.Ptr(armpanngfw.BooleanEnumTRUE), - // UserRegistered: to.Ptr(armpanngfw.BooleanEnumTRUE), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_getSupportInfo_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_GetSupportInfo_localRulestacksGetSupportInfoMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().GetSupportInfo(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientGetSupportInfoOptions{Email: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportInfo = armpanngfw.SupportInfo{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listAdvancedSecurityObjects_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListAdvancedSecurityObjects_localRulestacksListAdvancedSecurityObjectsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListAdvancedSecurityObjects(ctx, "rgopenapi", "lrs1", armpanngfw.AdvSecurityObjectTypeEnum("localRulestacks"), &armpanngfw.LocalRulestacksClientListAdvancedSecurityObjectsOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvSecurityObjectListResponse = armpanngfw.AdvSecurityObjectListResponse{ - // Value: &armpanngfw.AdvSecurityObjectModel{ - // Type: to.Ptr("localRulestacks"), - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // Description: to.Ptr("aaaaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listAdvancedSecurityObjects_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListAdvancedSecurityObjects_localRulestacksListAdvancedSecurityObjectsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListAdvancedSecurityObjects(ctx, "rgopenapi", "lrs1", armpanngfw.AdvSecurityObjectTypeEnum("localRulestacks"), &armpanngfw.LocalRulestacksClientListAdvancedSecurityObjectsOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvSecurityObjectListResponse = armpanngfw.AdvSecurityObjectListResponse{ - // Value: &armpanngfw.AdvSecurityObjectModel{ - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listAppIds_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListAppIDs_localRulestacksListAppIdsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListAppIDs(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListAppIDsOptions{AppIDVersion: to.Ptr("8543"), - AppPrefix: to.Ptr("pref"), - Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListAppIDResponse = armpanngfw.ListAppIDResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listAppIds_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListAppIDs_localRulestacksListAppIdsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListAppIDs(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListAppIDsOptions{AppIDVersion: nil, - AppPrefix: nil, - Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListAppIDResponse = armpanngfw.ListAppIDResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listCountries_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListCountries_localRulestacksListCountriesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListCountries(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListCountriesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountriesResponse = armpanngfw.CountriesResponse{ - // Value: []*armpanngfw.Country{ - // { - // Description: to.Ptr("aaaaa"), - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listCountries_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListCountries_localRulestacksListCountriesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListCountries(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListCountriesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CountriesResponse = armpanngfw.CountriesResponse{ - // Value: []*armpanngfw.Country{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listFirewalls_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListFirewalls_localRulestacksListFirewallsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListFirewalls(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListFirewallsResponse = armpanngfw.ListFirewallsResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listFirewalls_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListFirewalls_localRulestacksListFirewallsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListFirewalls(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListFirewallsResponse = armpanngfw.ListFirewallsResponse{ - // Value: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listPredefinedUrlCategories_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListPredefinedURLCategories_localRulestacksListPredefinedUrlCategoriesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListPredefinedURLCategories(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListPredefinedURLCategoriesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PredefinedURLCategoriesResponse = armpanngfw.PredefinedURLCategoriesResponse{ - // Value: []*armpanngfw.PredefinedURLCategory{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Action: to.Ptr("aaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listPredefinedUrlCategories_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListPredefinedURLCategories_localRulestacksListPredefinedUrlCategoriesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListPredefinedURLCategories(ctx, "rgopenapi", "lrs1", &armpanngfw.LocalRulestacksClientListPredefinedURLCategoriesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PredefinedURLCategoriesResponse = armpanngfw.PredefinedURLCategoriesResponse{ - // Value: []*armpanngfw.PredefinedURLCategory{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Action: to.Ptr("aaaaaaa"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listSecurityServices_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_ListSecurityServices_localRulestacksListSecurityServicesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListSecurityServices(ctx, "rgopenapi", "lrs1", armpanngfw.SecurityServicesTypeEnum("localRulestacks"), &armpanngfw.LocalRulestacksClientListSecurityServicesOptions{Skip: to.Ptr("a6a321"), - Top: to.Ptr[int32](20), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityServicesResponse = armpanngfw.SecurityServicesResponse{ - // Value: &armpanngfw.SecurityServicesTypeList{ - // Type: to.Ptr("localRulestacks"), - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // Description: to.Ptr("aaaaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_listSecurityServices_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_ListSecurityServices_localRulestacksListSecurityServicesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocalRulestacksClient().ListSecurityServices(ctx, "rgopenapi", "lrs1", armpanngfw.SecurityServicesTypeEnum("localRulestacks"), &armpanngfw.LocalRulestacksClientListSecurityServicesOptions{Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityServicesResponse = armpanngfw.SecurityServicesResponse{ - // Value: &armpanngfw.SecurityServicesTypeList{ - // Entry: []*armpanngfw.NameDescriptionObject{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_revert_MaximumSet_Gen.json -func ExampleLocalRulestacksClient_Revert_localRulestacksRevertMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLocalRulestacksClient().Revert(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRulestacks_revert_MinimumSet_Gen.json -func ExampleLocalRulestacksClient_Revert_localRulestacksRevertMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLocalRulestacksClient().Revert(ctx, "rgopenapi", "lrs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go index d786e70d9847..6f73fbdb2ff0 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -125,32 +124,6 @@ type CertificateObject struct { 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. @@ -178,32 +151,6 @@ type CertificateObjectGlobalRulestackResourceListResult struct { 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. @@ -429,17 +376,6 @@ type FirewallResourceUpdateProperties struct { 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 @@ -485,87 +421,6 @@ type FirewallStatusResourceListResult struct { 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. @@ -593,31 +448,6 @@ type FqdnListGlobalRulestackResourceListResult struct { 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. @@ -678,92 +508,6 @@ type FrontendSetting struct { 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 @@ -877,45 +621,6 @@ type ListFirewallsResponse struct { 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. @@ -1018,106 +723,6 @@ type LocalRulestackResourceUpdateProperties struct { 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 @@ -1210,6 +815,9 @@ type NetworkProfile struct { // Egress nat IP to use EgressNatIP []*IPAddress + // Non-RFC 1918 address + TrustedRanges []*string + // Vnet configurations VnetConfiguration *VnetConfiguration @@ -1266,11 +874,6 @@ type OperationListResult struct { 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 @@ -1323,44 +926,6 @@ type PlanData struct { 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. @@ -1388,43 +953,6 @@ type PostRulesResourceListResult struct { 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. @@ -1470,32 +998,6 @@ type PredefinedURLCategory struct { 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. @@ -1523,31 +1025,6 @@ type PrefixListGlobalRulestackResourceListResult struct { 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. diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go index 578fddec7e83..cab8447b375a 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -2105,6 +2104,7 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "enableEgressNat", n.EnableEgressNat) populate(objectMap, "networkType", n.NetworkType) populate(objectMap, "publicIps", n.PublicIPs) + populate(objectMap, "trustedRanges", n.TrustedRanges) populate(objectMap, "vnetConfiguration", n.VnetConfiguration) populate(objectMap, "vwanConfiguration", n.VwanConfiguration) return json.Marshal(objectMap) @@ -2131,6 +2131,9 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { case "publicIps": err = unpopulate(val, "PublicIPs", &n.PublicIPs) delete(rawMsg, key) + case "trustedRanges": + err = unpopulate(val, "TrustedRanges", &n.TrustedRanges) + delete(rawMsg, key) case "vnetConfiguration": err = unpopulate(val, "VnetConfiguration", &n.VnetConfiguration) delete(rawMsg, key) diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client.go index 16eaf70ca56c..9d8c81679508 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client_example_test.go deleted file mode 100644 index cf306e7641c8..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armpanngfw.OperationListResult{ - // Value: []*armpanngfw.Operation{ - // { - // Name: to.Ptr("aaa"), - // ActionType: to.Ptr(armpanngfw.ActionTypeInternal), - // Display: &armpanngfw.OperationDisplay{ - // Description: to.Ptr("aaaaaaaa"), - // Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Provider: to.Ptr("aaaaaaaaaaa"), - // Resource: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armpanngfw.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armpanngfw.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/options.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/options.go new file mode 100644 index 000000000000..2306e4631a92 --- /dev/null +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/options.go @@ -0,0 +1,535 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armpanngfw + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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.NewListAppIDsPager +// 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.NewListCountriesPager +// 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.NewListPredefinedURLCategoriesPager +// 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 +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go index 8a5f11ee5ec3..9ba66c53e2b9 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -44,7 +43,7 @@ func NewPostRulesClient(credential azcore.TokenCredential, options *arm.ClientOp // BeginCreateOrUpdate - Create a PostRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - priority - Post Rule priority // - resource - Resource create parameters. @@ -56,9 +55,10 @@ func (client *PostRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRu if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PostRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -67,20 +67,22 @@ func (client *PostRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRu // CreateOrUpdate - Create a PostRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PostRulesClient) createOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PostRulesResource, options *PostRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, priority, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,16 +101,19 @@ func (client *PostRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a PostRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - priority - Post Rule priority // - options - PostRulesClientBeginDeleteOptions contains the optional parameters for the PostRulesClient.BeginDelete method. @@ -118,9 +123,10 @@ func (client *PostRulesClient) BeginDelete(ctx context.Context, globalRulestackN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PostRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PostRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -129,20 +135,22 @@ func (client *PostRulesClient) BeginDelete(ctx context.Context, globalRulestackN // Delete - Delete a PostRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PostRulesClient) deleteOperation(ctx context.Context, globalRulestackName string, priority string, options *PostRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -161,7 +169,7 @@ func (client *PostRulesClient) deleteCreateRequest(ctx context.Context, globalRu return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,23 +178,26 @@ func (client *PostRulesClient) deleteCreateRequest(ctx context.Context, globalRu // Get - Get a PostRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PostRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PostRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PostRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PostRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -205,7 +216,7 @@ func (client *PostRulesClient) getCreateRequest(ctx context.Context, globalRules return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,23 +234,26 @@ func (client *PostRulesClient) getHandleResponse(resp *http.Response) (PostRules // GetCounters - Get counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PostRulesClientGetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PostRulesClientGetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PostRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PostRulesClientGetCountersResponse{}, err } - return client.getCountersHandleResponse(resp) + resp, err := client.getCountersHandleResponse(httpResp) + return resp, err } // getCountersCreateRequest creates the GetCounters request. @@ -258,7 +272,7 @@ func (client *PostRulesClient) getCountersCreateRequest(ctx context.Context, glo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -278,7 +292,7 @@ func (client *PostRulesClient) getCountersHandleResponse(resp *http.Response) (P // NewListPager - List PostRulesResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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] { @@ -321,7 +335,7 @@ func (client *PostRulesClient) listCreateRequest(ctx context.Context, globalRule return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,22 +353,24 @@ func (client *PostRulesClient) listHandleResponse(resp *http.Response) (PostRule // RefreshCounters - Refresh counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.refreshCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PostRulesClientRefreshCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PostRulesClientRefreshCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return PostRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PostRulesClientRefreshCountersResponse{}, err } return PostRulesClientRefreshCountersResponse{}, nil } @@ -375,7 +391,7 @@ func (client *PostRulesClient) refreshCountersCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -387,23 +403,26 @@ func (client *PostRulesClient) refreshCountersCreateRequest(ctx context.Context, // ResetCounters - Reset counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.resetCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PostRulesClientResetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PostRulesClientResetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PostRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PostRulesClientResetCountersResponse{}, err } - return client.resetCountersHandleResponse(resp) + resp, err := client.resetCountersHandleResponse(httpResp) + return resp, err } // resetCountersCreateRequest creates the ResetCounters request. @@ -422,7 +441,7 @@ func (client *PostRulesClient) resetCountersCreateRequest(ctx context.Context, g return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client_example_test.go deleted file mode 100644 index 15057bea1326..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/postrules_client_example_test.go +++ /dev/null @@ -1,629 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_List_MaximumSet_Gen.json -func ExamplePostRulesClient_NewListPager_postRulesListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPostRulesClient().NewListPager("lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PostRulesResourceListResult = armpanngfw.PostRulesResourceListResult{ - // Value: []*armpanngfw.PostRulesResource{ - // { - // Name: to.Ptr("aaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_List_MinimumSet_Gen.json -func ExamplePostRulesClient_NewListPager_postRulesListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPostRulesClient().NewListPager("lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PostRulesResourceListResult = armpanngfw.PostRulesResourceListResult{ - // Value: []*armpanngfw.PostRulesResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/postrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_Get_MaximumSet_Gen.json -func ExamplePostRulesClient_Get_postRulesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().Get(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PostRulesResource = armpanngfw.PostRulesResource{ - // Name: to.Ptr("aaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_Get_MinimumSet_Gen.json -func ExamplePostRulesClient_Get_postRulesGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().Get(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PostRulesResource = armpanngfw.PostRulesResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/postrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_CreateOrUpdate_MaximumSet_Gen.json -func ExamplePostRulesClient_BeginCreateOrUpdate_postRulesCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPostRulesClient().BeginCreateOrUpdate(ctx, "lrs1", "1", armpanngfw.PostRulesResource{ - Properties: &armpanngfw.RuleEntry{ - Description: to.Ptr("description of post rule"), - ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - Applications: []*string{ - to.Ptr("app1")}, - AuditComment: to.Ptr("example comment"), - Category: &armpanngfw.Category{ - Feeds: []*string{ - to.Ptr("feed")}, - URLCustom: []*string{ - to.Ptr("https://microsoft.com")}, - }, - DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - Destination: &armpanngfw.DestinationAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - FqdnLists: []*string{ - to.Ptr("FQDN1")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - Etag: to.Ptr("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0"), - InboundInspectionCertificate: to.Ptr("cert1"), - NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - ProtocolPortList: []*string{ - to.Ptr("80")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - RuleName: to.Ptr("postRule1"), - RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - Source: &armpanngfw.SourceAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - Tags: []*armpanngfw.TagInfo{ - { - Key: to.Ptr("keyName"), - Value: to.Ptr("value"), - }}, - Protocol: to.Ptr("HTTP"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PostRulesResource = armpanngfw.PostRulesResource{ - // Name: to.Ptr("aaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_CreateOrUpdate_MinimumSet_Gen.json -func ExamplePostRulesClient_BeginCreateOrUpdate_postRulesCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPostRulesClient().BeginCreateOrUpdate(ctx, "lrs1", "1", armpanngfw.PostRulesResource{ - Properties: &armpanngfw.RuleEntry{ - RuleName: to.Ptr("postRule1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PostRulesResource = armpanngfw.PostRulesResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/postrules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_Delete_MaximumSet_Gen.json -func ExamplePostRulesClient_BeginDelete_postRulesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPostRulesClient().BeginDelete(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_Delete_MinimumSet_Gen.json -func ExamplePostRulesClient_BeginDelete_postRulesDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPostRulesClient().BeginDelete(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_getCounters_MaximumSet_Gen.json -func ExamplePostRulesClient_GetCounters_postRulesGetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().GetCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientGetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // AppSeen: &armpanngfw.AppSeenData{ - // AppSeenList: []*armpanngfw.AppSeenInfo{ - // { - // Category: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Risk: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // StandardPorts: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SubCategory: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Tag: to.Ptr("aaaaaaaaaa"), - // Technology: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Title: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // Count: to.Ptr[int32](13), - // }, - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // HitCount: to.Ptr[int32](20), - // LastUpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RequestTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // RuleListName: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // RuleStackName: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_getCounters_MinimumSet_Gen.json -func ExamplePostRulesClient_GetCounters_postRulesGetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().GetCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientGetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_refreshCounters_MaximumSet_Gen.json -func ExamplePostRulesClient_RefreshCounters_postRulesRefreshCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPostRulesClient().RefreshCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientRefreshCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_refreshCounters_MinimumSet_Gen.json -func ExamplePostRulesClient_RefreshCounters_postRulesRefreshCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPostRulesClient().RefreshCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientRefreshCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_resetCounters_MaximumSet_Gen.json -func ExamplePostRulesClient_ResetCounters_postRulesResetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().ResetCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientResetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Priority: to.Ptr("aaaaaaa"), - // RuleListName: to.Ptr("aaaaa"), - // RuleName: to.Ptr("aaaaa"), - // RuleStackName: to.Ptr("aa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PostRules_resetCounters_MinimumSet_Gen.json -func ExamplePostRulesClient_ResetCounters_postRulesResetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPostRulesClient().ResetCounters(ctx, "lrs1", "1", &armpanngfw.PostRulesClientResetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go index dd308d09062b..886652a0f752 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -44,7 +43,7 @@ func NewPrefixListGlobalRulestackClient(credential azcore.TokenCredential, optio // BeginCreateOrUpdate - Create a PrefixListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - Local Rule priority // - resource - Resource create parameters. @@ -56,9 +55,10 @@ func (client *PrefixListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrefixListGlobalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -67,20 +67,22 @@ func (client *PrefixListGlobalRulestackClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Create a PrefixListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PrefixListGlobalRulestackClient) createOrUpdate(ctx context.Context, globalRulestackName string, name string, resource PrefixListGlobalRulestackResource, options *PrefixListGlobalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,16 +101,19 @@ func (client *PrefixListGlobalRulestackClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a PrefixListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - name - Local Rule priority // - options - PrefixListGlobalRulestackClientBeginDeleteOptions contains the optional parameters for the PrefixListGlobalRulestackClient.BeginDelete @@ -119,9 +124,10 @@ func (client *PrefixListGlobalRulestackClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListGlobalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrefixListGlobalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -130,20 +136,22 @@ func (client *PrefixListGlobalRulestackClient) BeginDelete(ctx context.Context, // Delete - Delete a PrefixListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PrefixListGlobalRulestackClient) deleteOperation(ctx context.Context, globalRulestackName string, name string, options *PrefixListGlobalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -162,7 +170,7 @@ func (client *PrefixListGlobalRulestackClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,24 +179,27 @@ func (client *PrefixListGlobalRulestackClient) deleteCreateRequest(ctx context.C // Get - Get a PrefixListGlobalRulestackResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, name, options) if err != nil { return PrefixListGlobalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrefixListGlobalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrefixListGlobalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrefixListGlobalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -207,7 +218,7 @@ func (client *PrefixListGlobalRulestackClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +235,7 @@ func (client *PrefixListGlobalRulestackClient) getHandleResponse(resp *http.Resp // NewListPager - List PrefixListGlobalRulestackResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - options - PrefixListGlobalRulestackClientListOptions contains the optional parameters for the PrefixListGlobalRulestackClient.NewListPager // method. @@ -268,7 +279,7 @@ func (client *PrefixListGlobalRulestackClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client_example_test.go deleted file mode 100644 index 15c51be5fa7f..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistglobalrulestack_client_example_test.go +++ /dev/null @@ -1,303 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_List_MaximumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_NewListPager_prefixListGlobalRulestackListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrefixListGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrefixListGlobalRulestackResourceListResult = armpanngfw.PrefixListGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.PrefixListGlobalRulestackResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // PrefixList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_List_MinimumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_NewListPager_prefixListGlobalRulestackListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrefixListGlobalRulestackClient().NewListPager("praval", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrefixListGlobalRulestackResourceListResult = armpanngfw.PrefixListGlobalRulestackResourceListResult{ - // Value: []*armpanngfw.PrefixListGlobalRulestackResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/prefixlists/prefixlists1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_Get_MaximumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_Get_prefixListGlobalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrefixListGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListGlobalRulestackResource = armpanngfw.PrefixListGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("comment"), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_Get_MinimumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_Get_prefixListGlobalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrefixListGlobalRulestackClient().Get(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListGlobalRulestackResource = armpanngfw.PrefixListGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/prefixlists/armid1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_BeginCreateOrUpdate_prefixListGlobalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.PrefixListGlobalRulestackResource{ - Properties: &armpanngfw.PrefixObject{ - Description: to.Ptr("string"), - AuditComment: to.Ptr("comment"), - Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - PrefixList: []*string{ - to.Ptr("1.0.0.0/24")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListGlobalRulestackResource = armpanngfw.PrefixListGlobalRulestackResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("comment"), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_BeginCreateOrUpdate_prefixListGlobalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListGlobalRulestackClient().BeginCreateOrUpdate(ctx, "praval", "armid1", armpanngfw.PrefixListGlobalRulestackResource{ - Properties: &armpanngfw.PrefixObject{ - PrefixList: []*string{ - to.Ptr("1.0.0.0/24")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListGlobalRulestackResource = armpanngfw.PrefixListGlobalRulestackResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/praval/prefixlists/armid1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_Delete_MaximumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_BeginDelete_prefixListGlobalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListGlobalRulestack_Delete_MinimumSet_Gen.json -func ExamplePrefixListGlobalRulestackClient_BeginDelete_prefixListGlobalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListGlobalRulestackClient().BeginDelete(ctx, "praval", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go index dc2c13877454..41897dcab576 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -47,7 +46,7 @@ func NewPrefixListLocalRulestackClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Create a PrefixListResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - Local Rule priority @@ -60,9 +59,10 @@ func (client *PrefixListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrefixListLocalRulestackClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *PrefixListLocalRulestackClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Create a PrefixListResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PrefixListLocalRulestackClient) createOrUpdate(ctx context.Context, resourceGroupName string, localRulestackName string, name string, resource PrefixListResource, options *PrefixListLocalRulestackClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, localRulestackName, name, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ func (client *PrefixListLocalRulestackClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a PrefixListResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - localRulestackName - LocalRulestack resource name // - name - Local Rule priority @@ -132,9 +137,10 @@ func (client *PrefixListLocalRulestackClient) BeginDelete(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrefixListLocalRulestackClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrefixListLocalRulestackClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ func (client *PrefixListLocalRulestackClient) BeginDelete(ctx context.Context, r // Delete - Delete a PrefixListResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PrefixListLocalRulestackClient) deleteOperation(ctx context.Context, resourceGroupName string, localRulestackName string, name string, options *PrefixListLocalRulestackClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -183,7 +191,7 @@ func (client *PrefixListLocalRulestackClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,25 +200,28 @@ func (client *PrefixListLocalRulestackClient) deleteCreateRequest(ctx context.Co // Get - Get a PrefixListResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, localRulestackName, name, options) if err != nil { return PrefixListLocalRulestackClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrefixListLocalRulestackClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrefixListLocalRulestackClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrefixListLocalRulestackClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,7 @@ func (client *PrefixListLocalRulestackClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,7 @@ func (client *PrefixListLocalRulestackClient) getHandleResponse(resp *http.Respo // NewListByLocalRulestacksPager - List PrefixListResource resources by LocalRulestacks // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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 @@ -307,7 +318,7 @@ func (client *PrefixListLocalRulestackClient) listByLocalRulestacksCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client_example_test.go deleted file mode 100644 index f69fa0e16939..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prefixlistlocalrulestack_client_example_test.go +++ /dev/null @@ -1,303 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_NewListByLocalRulestacksPager_prefixListLocalRulestackListByLocalRulestacksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrefixListLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrefixListResourceListResult = armpanngfw.PrefixListResourceListResult{ - // Value: []*armpanngfw.PrefixListResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aa"), - // ID: to.Ptr("aaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // AuditComment: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // PrefixList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_NewListByLocalRulestacksPager_prefixListLocalRulestackListByLocalRulestacksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrefixListLocalRulestackClient().NewListByLocalRulestacksPager("rgopenapi", "lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrefixListResourceListResult = armpanngfw.PrefixListResourceListResult{ - // Value: []*armpanngfw.PrefixListResource{ - // { - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/prefixlists/prefixlists1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_Get_MaximumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_Get_prefixListLocalRulestackGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrefixListLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListResource = armpanngfw.PrefixListResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("comment"), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_Get_MinimumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_Get_prefixListLocalRulestackGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrefixListLocalRulestackClient().Get(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListResource = armpanngfw.PrefixListResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/prefixlists/armid1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_BeginCreateOrUpdate_prefixListLocalRulestackCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.PrefixListResource{ - Properties: &armpanngfw.PrefixObject{ - Description: to.Ptr("string"), - AuditComment: to.Ptr("comment"), - Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - PrefixList: []*string{ - to.Ptr("1.0.0.0/24")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListResource = armpanngfw.PrefixListResource{ - // Name: to.Ptr("armid1"), - // Type: to.Ptr("certificates"), - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalrulestacks/armid1/certificates/armid1"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.PrefixObject{ - // Description: to.Ptr("string"), - // AuditComment: to.Ptr("comment"), - // Etag: to.Ptr("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_BeginCreateOrUpdate_prefixListLocalRulestackCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListLocalRulestackClient().BeginCreateOrUpdate(ctx, "rgopenapi", "lrs1", "armid1", armpanngfw.PrefixListResource{ - Properties: &armpanngfw.PrefixObject{ - PrefixList: []*string{ - to.Ptr("1.0.0.0/24")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrefixListResource = armpanngfw.PrefixListResource{ - // ID: to.Ptr("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourcegroups/rgopenapi/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/praval/prefixlists/armid1"), - // Properties: &armpanngfw.PrefixObject{ - // PrefixList: []*string{ - // to.Ptr("1.0.0.0/24")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_Delete_MaximumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_BeginDelete_prefixListLocalRulestackDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PrefixListLocalRulestack_Delete_MinimumSet_Gen.json -func ExamplePrefixListLocalRulestackClient_BeginDelete_prefixListLocalRulestackDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrefixListLocalRulestackClient().BeginDelete(ctx, "rgopenapi", "lrs1", "armid1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go index df91f4f60d5f..903201d957c9 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw @@ -44,7 +43,7 @@ func NewPreRulesClient(credential azcore.TokenCredential, options *arm.ClientOpt // BeginCreateOrUpdate - Create a PreRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - priority - Pre Rule priority // - resource - Resource create parameters. @@ -56,9 +55,10 @@ func (client *PreRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRul if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PreRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -67,20 +67,22 @@ func (client *PreRulesClient) BeginCreateOrUpdate(ctx context.Context, globalRul // CreateOrUpdate - Create a PreRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PreRulesClient) createOrUpdate(ctx context.Context, globalRulestackName string, priority string, resource PreRulesResource, options *PreRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, globalRulestackName, priority, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,16 +101,19 @@ func (client *PreRulesClient) createOrUpdateCreateRequest(ctx context.Context, g return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a PreRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - globalRulestackName - GlobalRulestack resource name // - priority - Pre Rule priority // - options - PreRulesClientBeginDeleteOptions contains the optional parameters for the PreRulesClient.BeginDelete method. @@ -118,9 +123,10 @@ func (client *PreRulesClient) BeginDelete(ctx context.Context, globalRulestackNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PreRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PreRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -129,20 +135,22 @@ func (client *PreRulesClient) BeginDelete(ctx context.Context, globalRulestackNa // Delete - Delete a PreRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 func (client *PreRulesClient) deleteOperation(ctx context.Context, globalRulestackName string, priority string, options *PreRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -161,7 +169,7 @@ func (client *PreRulesClient) deleteCreateRequest(ctx context.Context, globalRul return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,23 +178,26 @@ func (client *PreRulesClient) deleteCreateRequest(ctx context.Context, globalRul // Get - Get a PreRulesResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PreRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PreRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PreRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PreRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -205,7 +216,7 @@ func (client *PreRulesClient) getCreateRequest(ctx context.Context, globalRulest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,23 +234,26 @@ func (client *PreRulesClient) getHandleResponse(resp *http.Response) (PreRulesCl // GetCounters - Get counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.getCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PreRulesClientGetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PreRulesClientGetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PreRulesClientGetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PreRulesClientGetCountersResponse{}, err } - return client.getCountersHandleResponse(resp) + resp, err := client.getCountersHandleResponse(httpResp) + return resp, err } // getCountersCreateRequest creates the GetCounters request. @@ -258,7 +272,7 @@ func (client *PreRulesClient) getCountersCreateRequest(ctx context.Context, glob return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -278,7 +292,7 @@ func (client *PreRulesClient) getCountersHandleResponse(resp *http.Response) (Pr // NewListPager - List PreRulesResource resources by Tenant // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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] { @@ -321,7 +335,7 @@ func (client *PreRulesClient) listCreateRequest(ctx context.Context, globalRules return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,22 +353,24 @@ func (client *PreRulesClient) listHandleResponse(resp *http.Response) (PreRulesC // RefreshCounters - Refresh counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.refreshCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PreRulesClientRefreshCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PreRulesClientRefreshCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return PreRulesClientRefreshCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PreRulesClientRefreshCountersResponse{}, err } return PreRulesClientRefreshCountersResponse{}, nil } @@ -375,7 +391,7 @@ func (client *PreRulesClient) refreshCountersCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } @@ -387,23 +403,26 @@ func (client *PreRulesClient) refreshCountersCreateRequest(ctx context.Context, // ResetCounters - Reset counters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-29 +// Generated from API version 2023-09-01 // - 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) { + var err error req, err := client.resetCountersCreateRequest(ctx, globalRulestackName, priority, options) if err != nil { return PreRulesClientResetCountersResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PreRulesClientResetCountersResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PreRulesClientResetCountersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PreRulesClientResetCountersResponse{}, err } - return client.resetCountersHandleResponse(resp) + resp, err := client.resetCountersHandleResponse(httpResp) + return resp, err } // resetCountersCreateRequest creates the ResetCounters request. @@ -422,7 +441,7 @@ func (client *PreRulesClient) resetCountersCreateRequest(ctx context.Context, gl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-29") + reqQP.Set("api-version", "2023-09-01") if options != nil && options.FirewallName != nil { reqQP.Set("firewallName", *options.FirewallName) } diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client_example_test.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client_example_test.go deleted file mode 100644 index e1eeb63dd77b..000000000000 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/prerules_client_example_test.go +++ /dev/null @@ -1,629 +0,0 @@ -//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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_List_MaximumSet_Gen.json -func ExamplePreRulesClient_NewListPager_preRulesListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPreRulesClient().NewListPager("lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PreRulesResourceListResult = armpanngfw.PreRulesResourceListResult{ - // Value: []*armpanngfw.PreRulesResource{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_List_MinimumSet_Gen.json -func ExamplePreRulesClient_NewListPager_preRulesListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPreRulesClient().NewListPager("lrs1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PreRulesResourceListResult = armpanngfw.PreRulesResourceListResult{ - // Value: []*armpanngfw.PreRulesResource{ - // { - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/prerules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_Get_MaximumSet_Gen.json -func ExamplePreRulesClient_Get_preRulesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().Get(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PreRulesResource = armpanngfw.PreRulesResource{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_Get_MinimumSet_Gen.json -func ExamplePreRulesClient_Get_preRulesGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().Get(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PreRulesResource = armpanngfw.PreRulesResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/prerules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_CreateOrUpdate_MaximumSet_Gen.json -func ExamplePreRulesClient_BeginCreateOrUpdate_preRulesCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPreRulesClient().BeginCreateOrUpdate(ctx, "lrs1", "1", armpanngfw.PreRulesResource{ - Properties: &armpanngfw.RuleEntry{ - Description: to.Ptr("description of pre rule"), - ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - Applications: []*string{ - to.Ptr("app1")}, - AuditComment: to.Ptr("example comment"), - Category: &armpanngfw.Category{ - Feeds: []*string{ - to.Ptr("feed")}, - URLCustom: []*string{ - to.Ptr("https://microsoft.com")}, - }, - DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - Destination: &armpanngfw.DestinationAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - FqdnLists: []*string{ - to.Ptr("FQDN1")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - Etag: to.Ptr("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0"), - InboundInspectionCertificate: to.Ptr("cert1"), - NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - ProtocolPortList: []*string{ - to.Ptr("80")}, - ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateAccepted), - RuleName: to.Ptr("preRule1"), - RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - Source: &armpanngfw.SourceAddr{ - Cidrs: []*string{ - to.Ptr("1.0.0.1/10")}, - Countries: []*string{ - to.Ptr("India")}, - Feeds: []*string{ - to.Ptr("feed")}, - PrefixLists: []*string{ - to.Ptr("PL1")}, - }, - Tags: []*armpanngfw.TagInfo{ - { - Key: to.Ptr("keyName"), - Value: to.Ptr("value"), - }}, - Protocol: to.Ptr("HTTP"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PreRulesResource = armpanngfw.PreRulesResource{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SystemData: &armpanngfw.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // CreatedBy: to.Ptr("praval"), - // CreatedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // LastModifiedBy: to.Ptr("praval"), - // LastModifiedByType: to.Ptr(armpanngfw.CreatedByTypeUser), - // }, - // Properties: &armpanngfw.RuleEntry{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ActionType: to.Ptr(armpanngfw.ActionEnumAllow), - // Applications: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // AuditComment: to.Ptr("aaa"), - // Category: &armpanngfw.Category{ - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // URLCustom: []*string{ - // to.Ptr("aaaaa")}, - // }, - // DecryptionRuleType: to.Ptr(armpanngfw.DecryptionRuleTypeEnumSSLOutboundInspection), - // Destination: &armpanngfw.DestinationAddr{ - // Cidrs: []*string{ - // to.Ptr("aaaaaaa")}, - // Countries: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // FqdnLists: []*string{ - // to.Ptr("aaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // EnableLogging: to.Ptr(armpanngfw.StateEnumDISABLED), - // Etag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // InboundInspectionCertificate: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // NegateDestination: to.Ptr(armpanngfw.BooleanEnumTRUE), - // NegateSource: to.Ptr(armpanngfw.BooleanEnumTRUE), - // Priority: to.Ptr[int32](24), - // ProtocolPortList: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr(armpanngfw.ProvisioningStateSucceeded), - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // RuleState: to.Ptr(armpanngfw.StateEnumDISABLED), - // Source: &armpanngfw.SourceAddr{ - // Cidrs: []*string{ - // to.Ptr("aaa")}, - // Countries: []*string{ - // to.Ptr("aaaaa")}, - // Feeds: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaa")}, - // PrefixLists: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }, - // Tags: []*armpanngfw.TagInfo{ - // { - // Key: to.Ptr("keyName"), - // Value: to.Ptr("value"), - // }}, - // Protocol: to.Ptr("aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_CreateOrUpdate_MinimumSet_Gen.json -func ExamplePreRulesClient_BeginCreateOrUpdate_preRulesCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPreRulesClient().BeginCreateOrUpdate(ctx, "lrs1", "1", armpanngfw.PreRulesResource{ - Properties: &armpanngfw.RuleEntry{ - RuleName: to.Ptr("preRule1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PreRulesResource = armpanngfw.PreRulesResource{ - // ID: to.Ptr("/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/lrs1/prerules/1"), - // Properties: &armpanngfw.RuleEntry{ - // RuleName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_Delete_MaximumSet_Gen.json -func ExamplePreRulesClient_BeginDelete_preRulesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPreRulesClient().BeginDelete(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_Delete_MinimumSet_Gen.json -func ExamplePreRulesClient_BeginDelete_preRulesDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPreRulesClient().BeginDelete(ctx, "lrs1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_getCounters_MaximumSet_Gen.json -func ExamplePreRulesClient_GetCounters_preRulesGetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().GetCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientGetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // AppSeen: &armpanngfw.AppSeenData{ - // AppSeenList: []*armpanngfw.AppSeenInfo{ - // { - // Category: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Risk: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // StandardPorts: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SubCategory: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Tag: to.Ptr("aaaaaaaaaa"), - // Technology: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Title: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // Count: to.Ptr[int32](13), - // }, - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // HitCount: to.Ptr[int32](20), - // LastUpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RequestTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // RuleListName: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // RuleStackName: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-09T05:08:24.229Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_getCounters_MinimumSet_Gen.json -func ExamplePreRulesClient_GetCounters_preRulesGetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().GetCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientGetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounter = armpanngfw.RuleCounter{ - // Priority: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // RuleName: to.Ptr("aaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_refreshCounters_MaximumSet_Gen.json -func ExamplePreRulesClient_RefreshCounters_preRulesRefreshCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPreRulesClient().RefreshCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientRefreshCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_refreshCounters_MinimumSet_Gen.json -func ExamplePreRulesClient_RefreshCounters_preRulesRefreshCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPreRulesClient().RefreshCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientRefreshCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_resetCounters_MaximumSet_Gen.json -func ExamplePreRulesClient_ResetCounters_preRulesResetCountersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().ResetCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientResetCountersOptions{FirewallName: to.Ptr("firewall1")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // FirewallName: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Priority: to.Ptr("aaaaaaa"), - // RuleListName: to.Ptr("aaaaa"), - // RuleName: to.Ptr("aaaaa"), - // RuleStackName: to.Ptr("aa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/PreRules_resetCounters_MinimumSet_Gen.json -func ExamplePreRulesClient_ResetCounters_preRulesResetCountersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armpanngfw.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPreRulesClient().ResetCounters(ctx, "lrs1", "1", &armpanngfw.PreRulesClientResetCountersOptions{FirewallName: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleCounterReset = armpanngfw.RuleCounterReset{ - // } -} diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go index 45565bcd1f6d..4765e499f8d2 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/response_types.go @@ -3,14 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw // CertificateObjectGlobalRulestackClientCreateOrUpdateResponse contains the response from method CertificateObjectGlobalRulestackClient.BeginCreateOrUpdate. type CertificateObjectGlobalRulestackClientCreateOrUpdateResponse struct { + // GlobalRulestack Certificate Object CertificateObjectGlobalRulestackResource } @@ -21,16 +21,19 @@ type CertificateObjectGlobalRulestackClientDeleteResponse struct { // CertificateObjectGlobalRulestackClientGetResponse contains the response from method CertificateObjectGlobalRulestackClient.Get. type CertificateObjectGlobalRulestackClientGetResponse struct { + // GlobalRulestack Certificate Object CertificateObjectGlobalRulestackResource } // CertificateObjectGlobalRulestackClientListResponse contains the response from method CertificateObjectGlobalRulestackClient.NewListPager. type CertificateObjectGlobalRulestackClientListResponse struct { + // The response of a CertificateObjectGlobalRulestackResource list operation. CertificateObjectGlobalRulestackResourceListResult } // CertificateObjectLocalRulestackClientCreateOrUpdateResponse contains the response from method CertificateObjectLocalRulestackClient.BeginCreateOrUpdate. type CertificateObjectLocalRulestackClientCreateOrUpdateResponse struct { + // LocalRulestack Certificate Object CertificateObjectLocalRulestackResource } @@ -41,26 +44,31 @@ type CertificateObjectLocalRulestackClientDeleteResponse struct { // CertificateObjectLocalRulestackClientGetResponse contains the response from method CertificateObjectLocalRulestackClient.Get. type CertificateObjectLocalRulestackClientGetResponse struct { + // LocalRulestack Certificate Object CertificateObjectLocalRulestackResource } // CertificateObjectLocalRulestackClientListByLocalRulestacksResponse contains the response from method CertificateObjectLocalRulestackClient.NewListByLocalRulestacksPager. type CertificateObjectLocalRulestackClientListByLocalRulestacksResponse struct { + // The response of a CertificateObjectLocalRulestackResource list operation. CertificateObjectLocalRulestackResourceListResult } // FirewallStatusClientGetResponse contains the response from method FirewallStatusClient.Get. type FirewallStatusClientGetResponse struct { + // Firewall Status FirewallStatusResource } // FirewallStatusClientListByFirewallsResponse contains the response from method FirewallStatusClient.NewListByFirewallsPager. type FirewallStatusClientListByFirewallsResponse struct { + // The response of a FirewallStatusResource list operation. FirewallStatusResourceListResult } // FirewallsClientCreateOrUpdateResponse contains the response from method FirewallsClient.BeginCreateOrUpdate. type FirewallsClientCreateOrUpdateResponse struct { + // PaloAltoNetworks Firewall FirewallResource } @@ -71,31 +79,37 @@ type FirewallsClientDeleteResponse struct { // FirewallsClientGetGlobalRulestackResponse contains the response from method FirewallsClient.GetGlobalRulestack. type FirewallsClientGetGlobalRulestackResponse struct { + // PAN Rulestack Describe Object GlobalRulestackInfo } // FirewallsClientGetLogProfileResponse contains the response from method FirewallsClient.GetLogProfile. type FirewallsClientGetLogProfileResponse struct { + // Log Settings for Firewall LogSettings } // FirewallsClientGetResponse contains the response from method FirewallsClient.Get. type FirewallsClientGetResponse struct { + // PaloAltoNetworks Firewall FirewallResource } // FirewallsClientGetSupportInfoResponse contains the response from method FirewallsClient.GetSupportInfo. type FirewallsClientGetSupportInfoResponse struct { + // Support information for the resource SupportInfo } // FirewallsClientListByResourceGroupResponse contains the response from method FirewallsClient.NewListByResourceGroupPager. type FirewallsClientListByResourceGroupResponse struct { + // The response of a FirewallResource list operation. FirewallResourceListResult } // FirewallsClientListBySubscriptionResponse contains the response from method FirewallsClient.NewListBySubscriptionPager. type FirewallsClientListBySubscriptionResponse struct { + // The response of a FirewallResource list operation. FirewallResourceListResult } @@ -106,11 +120,13 @@ type FirewallsClientSaveLogProfileResponse struct { // FirewallsClientUpdateResponse contains the response from method FirewallsClient.Update. type FirewallsClientUpdateResponse struct { + // PaloAltoNetworks Firewall FirewallResource } // FqdnListGlobalRulestackClientCreateOrUpdateResponse contains the response from method FqdnListGlobalRulestackClient.BeginCreateOrUpdate. type FqdnListGlobalRulestackClientCreateOrUpdateResponse struct { + // GlobalRulestack fqdnList FqdnListGlobalRulestackResource } @@ -121,16 +137,19 @@ type FqdnListGlobalRulestackClientDeleteResponse struct { // FqdnListGlobalRulestackClientGetResponse contains the response from method FqdnListGlobalRulestackClient.Get. type FqdnListGlobalRulestackClientGetResponse struct { + // GlobalRulestack fqdnList FqdnListGlobalRulestackResource } // FqdnListGlobalRulestackClientListResponse contains the response from method FqdnListGlobalRulestackClient.NewListPager. type FqdnListGlobalRulestackClientListResponse struct { + // The response of a FqdnListGlobalRulestackResource list operation. FqdnListGlobalRulestackResourceListResult } // FqdnListLocalRulestackClientCreateOrUpdateResponse contains the response from method FqdnListLocalRulestackClient.BeginCreateOrUpdate. type FqdnListLocalRulestackClientCreateOrUpdateResponse struct { + // LocalRulestack fqdnList FqdnListLocalRulestackResource } @@ -141,11 +160,13 @@ type FqdnListLocalRulestackClientDeleteResponse struct { // FqdnListLocalRulestackClientGetResponse contains the response from method FqdnListLocalRulestackClient.Get. type FqdnListLocalRulestackClientGetResponse struct { + // LocalRulestack fqdnList FqdnListLocalRulestackResource } // FqdnListLocalRulestackClientListByLocalRulestacksResponse contains the response from method FqdnListLocalRulestackClient.NewListByLocalRulestacksPager. type FqdnListLocalRulestackClientListByLocalRulestacksResponse struct { + // The response of a FqdnListLocalRulestackResource list operation. FqdnListLocalRulestackResourceListResult } @@ -156,6 +177,7 @@ type GlobalRulestackClientCommitResponse struct { // GlobalRulestackClientCreateOrUpdateResponse contains the response from method GlobalRulestackClient.BeginCreateOrUpdate. type GlobalRulestackClientCreateOrUpdateResponse struct { + // PaloAltoNetworks GlobalRulestack GlobalRulestackResource } @@ -166,16 +188,19 @@ type GlobalRulestackClientDeleteResponse struct { // GlobalRulestackClientGetChangeLogResponse contains the response from method GlobalRulestackClient.GetChangeLog. type GlobalRulestackClientGetChangeLogResponse struct { + // Changelog list Changelog } // GlobalRulestackClientGetResponse contains the response from method GlobalRulestackClient.Get. type GlobalRulestackClientGetResponse struct { + // PaloAltoNetworks GlobalRulestack GlobalRulestackResource } // GlobalRulestackClientListAdvancedSecurityObjectsResponse contains the response from method GlobalRulestackClient.ListAdvancedSecurityObjects. type GlobalRulestackClientListAdvancedSecurityObjectsResponse struct { + // advanced security object AdvSecurityObjectListResponse } @@ -186,26 +211,31 @@ type GlobalRulestackClientListAppIDsResponse struct { // GlobalRulestackClientListCountriesResponse contains the response from method GlobalRulestackClient.ListCountries. type GlobalRulestackClientListCountriesResponse struct { + // Countries Response Object CountriesResponse } // GlobalRulestackClientListFirewallsResponse contains the response from method GlobalRulestackClient.ListFirewalls. type GlobalRulestackClientListFirewallsResponse struct { + // List firewalls response ListFirewallsResponse } // GlobalRulestackClientListPredefinedURLCategoriesResponse contains the response from method GlobalRulestackClient.ListPredefinedURLCategories. type GlobalRulestackClientListPredefinedURLCategoriesResponse struct { + // predefined url categories response PredefinedURLCategoriesResponse } // GlobalRulestackClientListResponse contains the response from method GlobalRulestackClient.NewListPager. type GlobalRulestackClientListResponse struct { + // The response of a GlobalRulestackResource list operation. GlobalRulestackResourceListResult } // GlobalRulestackClientListSecurityServicesResponse contains the response from method GlobalRulestackClient.ListSecurityServices. type GlobalRulestackClientListSecurityServicesResponse struct { + // Security services list response SecurityServicesResponse } @@ -216,11 +246,13 @@ type GlobalRulestackClientRevertResponse struct { // GlobalRulestackClientUpdateResponse contains the response from method GlobalRulestackClient.Update. type GlobalRulestackClientUpdateResponse struct { + // PaloAltoNetworks GlobalRulestack GlobalRulestackResource } // LocalRulesClientCreateOrUpdateResponse contains the response from method LocalRulesClient.BeginCreateOrUpdate. type LocalRulesClientCreateOrUpdateResponse struct { + // LocalRulestack rule list LocalRulesResource } @@ -231,16 +263,19 @@ type LocalRulesClientDeleteResponse struct { // LocalRulesClientGetCountersResponse contains the response from method LocalRulesClient.GetCounters. type LocalRulesClientGetCountersResponse struct { + // Rule counter RuleCounter } // LocalRulesClientGetResponse contains the response from method LocalRulesClient.Get. type LocalRulesClientGetResponse struct { + // LocalRulestack rule list LocalRulesResource } // LocalRulesClientListByLocalRulestacksResponse contains the response from method LocalRulesClient.NewListByLocalRulestacksPager. type LocalRulesClientListByLocalRulestacksResponse struct { + // The response of a LocalRulesResource list operation. LocalRulesResourceListResult } @@ -251,6 +286,7 @@ type LocalRulesClientRefreshCountersResponse struct { // LocalRulesClientResetCountersResponse contains the response from method LocalRulesClient.ResetCounters. type LocalRulesClientResetCountersResponse struct { + // Rule counter reset RuleCounterReset } @@ -261,6 +297,7 @@ type LocalRulestacksClientCommitResponse struct { // LocalRulestacksClientCreateOrUpdateResponse contains the response from method LocalRulestacksClient.BeginCreateOrUpdate. type LocalRulestacksClientCreateOrUpdateResponse struct { + // PaloAltoNetworks LocalRulestack LocalRulestackResource } @@ -271,56 +308,66 @@ type LocalRulestacksClientDeleteResponse struct { // LocalRulestacksClientGetChangeLogResponse contains the response from method LocalRulestacksClient.GetChangeLog. type LocalRulestacksClientGetChangeLogResponse struct { + // Changelog list Changelog } // LocalRulestacksClientGetResponse contains the response from method LocalRulestacksClient.Get. type LocalRulestacksClientGetResponse struct { + // PaloAltoNetworks LocalRulestack LocalRulestackResource } // LocalRulestacksClientGetSupportInfoResponse contains the response from method LocalRulestacksClient.GetSupportInfo. type LocalRulestacksClientGetSupportInfoResponse struct { + // Support information for the resource SupportInfo } // LocalRulestacksClientListAdvancedSecurityObjectsResponse contains the response from method LocalRulestacksClient.ListAdvancedSecurityObjects. type LocalRulestacksClientListAdvancedSecurityObjectsResponse struct { + // advanced security object AdvSecurityObjectListResponse } -// LocalRulestacksClientListAppIDsResponse contains the response from method LocalRulestacksClient.ListAppIDs. +// LocalRulestacksClientListAppIDsResponse contains the response from method LocalRulestacksClient.NewListAppIDsPager. type LocalRulestacksClientListAppIDsResponse struct { ListAppIDResponse } // LocalRulestacksClientListByResourceGroupResponse contains the response from method LocalRulestacksClient.NewListByResourceGroupPager. type LocalRulestacksClientListByResourceGroupResponse struct { + // The response of a LocalRulestackResource list operation. LocalRulestackResourceListResult } // LocalRulestacksClientListBySubscriptionResponse contains the response from method LocalRulestacksClient.NewListBySubscriptionPager. type LocalRulestacksClientListBySubscriptionResponse struct { + // The response of a LocalRulestackResource list operation. LocalRulestackResourceListResult } -// LocalRulestacksClientListCountriesResponse contains the response from method LocalRulestacksClient.ListCountries. +// LocalRulestacksClientListCountriesResponse contains the response from method LocalRulestacksClient.NewListCountriesPager. type LocalRulestacksClientListCountriesResponse struct { + // Countries Response Object CountriesResponse } // LocalRulestacksClientListFirewallsResponse contains the response from method LocalRulestacksClient.ListFirewalls. type LocalRulestacksClientListFirewallsResponse struct { + // List firewalls response ListFirewallsResponse } -// LocalRulestacksClientListPredefinedURLCategoriesResponse contains the response from method LocalRulestacksClient.ListPredefinedURLCategories. +// LocalRulestacksClientListPredefinedURLCategoriesResponse contains the response from method LocalRulestacksClient.NewListPredefinedURLCategoriesPager. type LocalRulestacksClientListPredefinedURLCategoriesResponse struct { + // predefined url categories response PredefinedURLCategoriesResponse } // LocalRulestacksClientListSecurityServicesResponse contains the response from method LocalRulestacksClient.ListSecurityServices. type LocalRulestacksClientListSecurityServicesResponse struct { + // Security services list response SecurityServicesResponse } @@ -331,16 +378,19 @@ type LocalRulestacksClientRevertResponse struct { // LocalRulestacksClientUpdateResponse contains the response from method LocalRulestacksClient.Update. type LocalRulestacksClientUpdateResponse struct { + // PaloAltoNetworks LocalRulestack LocalRulestackResource } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } // PostRulesClientCreateOrUpdateResponse contains the response from method PostRulesClient.BeginCreateOrUpdate. type PostRulesClientCreateOrUpdateResponse struct { + // PostRulestack rule list PostRulesResource } @@ -351,16 +401,19 @@ type PostRulesClientDeleteResponse struct { // PostRulesClientGetCountersResponse contains the response from method PostRulesClient.GetCounters. type PostRulesClientGetCountersResponse struct { + // Rule counter RuleCounter } // PostRulesClientGetResponse contains the response from method PostRulesClient.Get. type PostRulesClientGetResponse struct { + // PostRulestack rule list PostRulesResource } // PostRulesClientListResponse contains the response from method PostRulesClient.NewListPager. type PostRulesClientListResponse struct { + // The response of a PostRulesResource list operation. PostRulesResourceListResult } @@ -371,11 +424,13 @@ type PostRulesClientRefreshCountersResponse struct { // PostRulesClientResetCountersResponse contains the response from method PostRulesClient.ResetCounters. type PostRulesClientResetCountersResponse struct { + // Rule counter reset RuleCounterReset } // PreRulesClientCreateOrUpdateResponse contains the response from method PreRulesClient.BeginCreateOrUpdate. type PreRulesClientCreateOrUpdateResponse struct { + // PreRulestack rule list PreRulesResource } @@ -386,16 +441,19 @@ type PreRulesClientDeleteResponse struct { // PreRulesClientGetCountersResponse contains the response from method PreRulesClient.GetCounters. type PreRulesClientGetCountersResponse struct { + // Rule counter RuleCounter } // PreRulesClientGetResponse contains the response from method PreRulesClient.Get. type PreRulesClientGetResponse struct { + // PreRulestack rule list PreRulesResource } // PreRulesClientListResponse contains the response from method PreRulesClient.NewListPager. type PreRulesClientListResponse struct { + // The response of a PreRulesResource list operation. PreRulesResourceListResult } @@ -406,11 +464,13 @@ type PreRulesClientRefreshCountersResponse struct { // PreRulesClientResetCountersResponse contains the response from method PreRulesClient.ResetCounters. type PreRulesClientResetCountersResponse struct { + // Rule counter reset RuleCounterReset } // PrefixListGlobalRulestackClientCreateOrUpdateResponse contains the response from method PrefixListGlobalRulestackClient.BeginCreateOrUpdate. type PrefixListGlobalRulestackClientCreateOrUpdateResponse struct { + // GlobalRulestack prefixList PrefixListGlobalRulestackResource } @@ -421,16 +481,19 @@ type PrefixListGlobalRulestackClientDeleteResponse struct { // PrefixListGlobalRulestackClientGetResponse contains the response from method PrefixListGlobalRulestackClient.Get. type PrefixListGlobalRulestackClientGetResponse struct { + // GlobalRulestack prefixList PrefixListGlobalRulestackResource } // PrefixListGlobalRulestackClientListResponse contains the response from method PrefixListGlobalRulestackClient.NewListPager. type PrefixListGlobalRulestackClientListResponse struct { + // The response of a PrefixListGlobalRulestackResource list operation. PrefixListGlobalRulestackResourceListResult } // PrefixListLocalRulestackClientCreateOrUpdateResponse contains the response from method PrefixListLocalRulestackClient.BeginCreateOrUpdate. type PrefixListLocalRulestackClientCreateOrUpdateResponse struct { + // LocalRulestack prefixList PrefixListResource } @@ -441,10 +504,12 @@ type PrefixListLocalRulestackClientDeleteResponse struct { // PrefixListLocalRulestackClientGetResponse contains the response from method PrefixListLocalRulestackClient.Get. type PrefixListLocalRulestackClientGetResponse struct { + // LocalRulestack prefixList PrefixListResource } // PrefixListLocalRulestackClientListByLocalRulestacksResponse contains the response from method PrefixListLocalRulestackClient.NewListByLocalRulestacksPager. type PrefixListLocalRulestackClientListByLocalRulestacksResponse struct { + // The response of a PrefixListResource list operation. PrefixListResourceListResult } diff --git a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go index b37eb2234926..c39f4f6a9d04 100644 --- a/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go +++ b/sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armpanngfw